473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Oct 17 '07 #1
3 5077
"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.

Oct 17 '07 #2
On Oct 16, 10:57 pm, VUNETdotUS <vunet...@gmail.comwrote:
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

Oct 17 '07 #3
On Oct 17, 1:51 pm, "Dave Anderson" <NPQRWPDWZ...@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), @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

Oct 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
0
by: Michael B Allen | last post by:
How can I zoom in on what's going on below? $ archivemail -n ~/Maildir/.Lists.* /home/miallen/Maildir/.Lists.CIFS: I would have archived 11 of 29 message(s) in 0.1 seconds...
3
by: dont bother | last post by:
Hey, I have been trying to parse emails: But I could not find any examples or snippets of parsing emails in python from the documentation. Google did not help me much too. I am trying to...
8
by: yerk5 | last post by:
Does js have some way of doing what I want here: I want to paste a multiline block of text into a TEXTAREA form field, and there is data in the block of text that I want to extract into a...
5
by: John Smith | last post by:
Hi, I've been carefully storing my dates as ISO dates in a DB and now have to add an RSS feed to a website. Is there an easy way to convert these dates to RFC822 compliant dates ? I've had a...
4
by: Nemesis | last post by:
Hi all, I found that the function parsedate_tz of the rfc822 module has a bug (or at least I think so). I found a usenet article (message-id: <2714d.q75200@myg.winews.net>) that has this Date...
1
by: praba kar | last post by:
Dear All, I am new to python world. I have pasted my code which I used it to build rfc822 format mails for webbased mailing system task(which is like to yahoo.com web interface). Now I am...
5
by: Mahesha | last post by:
Hello, I need help in replacing one string pattern with another. Ex: I have a financial security expression like log(T 3.25 6/24/2004)/sqrt(T 4.5 6/19/2002) Here "T 3.25 6/24/2004" is a...
0
by: Nikolaus Schulz | last post by:
Hi, while playing with the rfc822 module and imaplib, I've found the following weird behaviour. Quickstart: rfc822.Message(fp) instantiates a rfc822.Message object from a file object fp. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.