Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Help Parsing RFC822 Formatted Date

Reply
Thread Tools

Help Parsing RFC822 Formatted Date

 
 
VUNETdotUS
Guest
Posts: n/a
 
      10-17-2007
How can I parse RFC822 date format Sat, 13 Oct 2007 22:09:03 PDT to MM/
DD/YYYY?
Any reference you can recommend?
Thanks

 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      10-17-2007
"VUNETdotUS" wrote:
> How can I parse RFC822 date format Sat, 13 Oct 2007 22:09:03 PDT to
> MM/DD/YYYY?


This is not really an ASP question, but here's a JScript answer:

Date.prototype.toMDCY = function() { ...insert code for
formatting... }**
return new Date("Sat, 13 Oct 2007 22:09:03 PDT").toMDCY()

http://msdn2.microsoft.com/en-us/library/cd9w2te4.aspx

Of course, this is time-zone dependent. On my system, this becomes
10/14/2007.

If you can stuff it in a SQL date variable, MSSQL has DATETIME styles for
converting to character data:

CONVERT(VARCHAR(10), @YourDateVariableHere, 101)
http://msdn2.microsoft.com/en-us/library/ms187928.aspx

I really couldn't say what VBScript would require.



**For example, assume you have already dealt with Number.prototype.pad...

Date.prototype.toMDCY = function() {
return (this.getMonth()+1).pad(2) + "/" + this.getDate().pad(2) +
"/" + this.getFullYear()
}


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

 
Reply With Quote
 
 
 
 
VUNETdotUS
Guest
Posts: n/a
 
      10-17-2007
On Oct 16, 10:57 pm, VUNETdotUS <(E-Mail Removed)> wrote:
> How can I parse RFC822 date format Sat, 13 Oct 2007 22:09:03 PDT to MM/
> DD/YYYY?
> Any reference you can recommend?
> Thanks


What I mean is there an easier way to parse other than splitting by
space, converting Oct to 10, etc.
Thanks

 
Reply With Quote
 
VUNETdotUS
Guest
Posts: n/a
 
      10-18-2007
On Oct 17, 1:51 pm, "Dave Anderson" <(E-Mail Removed)>
wrote:
> "VUNETdotUS" wrote:
> > How can I parse RFC822 date format Sat, 13 Oct 2007 22:09:03 PDT to
> > MM/DD/YYYY?

>
> This is not really an ASP question, but here's a JScript answer:
>
> Date.prototype.toMDCY = function() { ...insert code for
> formatting... }**
> return new Date("Sat, 13 Oct 2007 22:09:03 PDT").toMDCY()
>
> http://msdn2.microsoft.com/en-us/library/cd9w2te4.aspx
>
> Of course, this is time-zone dependent. On my system, this becomes
> 10/14/2007.
>
> If you can stuff it in a SQL date variable, MSSQL has DATETIME styles for
> converting to character data:
>
> CONVERT(VARCHAR(10), @YourDateVariableHere, 101)
> http://msdn2.microsoft.com/en-us/library/ms187928.aspx
>
> I really couldn't say what VBScript would require.
>
> **For example, assume you have already dealt with Number.prototype.pad...
>
> Date.prototype.toMDCY = function() {
> return (this.getMonth()+1).pad(2) + "/" + this.getDate().pad(2) +
> "/" + this.getFullYear()
> }
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message. Use
> of this email address implies consent to these terms.


thanks Dave

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaMail - RFC822 Rico Java 4 12-25-2004 06:36 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
rfc822 regexp Vladimir Litovka Perl 1 02-04-2004 12:49 PM
rfc822.py date parsing problem Michael B Allen Python 0 01-17-2004 11:15 PM
Dates from Strings in RFC822 format Darren Davison Java 2 07-23-2003 07:27 PM



Advertisments