Help Parsing RFC822 Formatted Date

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
vunet.us [ Mi, 17 Oktober 2007 04:57 ] [ ID #1847305 ]

Re: Help Parsing RFC822 Formatted Date

"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), [at] 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.
Dave Anderson [ Mi, 17 Oktober 2007 19:51 ] [ ID #1847318 ]

Re: Help Parsing RFC822 Formatted Date

On Oct 16, 10:57 pm, VUNETdotUS <vunet... [at] gmail.com> 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
vunet.us [ Mi, 17 Oktober 2007 22:34 ] [ ID #1847319 ]

Re: Help Parsing RFC822 Formatted Date

On Oct 17, 1:51 pm, "Dave Anderson" <NPQRWPDWZ... [at] spammotel.com>
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), [at] 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
vunet.us [ Do, 18 Oktober 2007 16:51 ] [ ID #1848285 ]
Webserver » microsoft.public.inetserver.asp.general » Help Parsing RFC822 Formatted Date

Vorheriges Thema: internet explorer cannot read post data from form
Nächstes Thema: passwords in the source?