473,657 Members | 2,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5087
"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), @YourDateVariab leHere, 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.prototyp e.pad...

Date.prototype. toMDCY = function() {
return (this.getMonth( )+1).pad(2) + "/" + this.getDate(). pad(2) +
"/" + this.getFullYea r()
}
--
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...@s pammotel.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), @YourDateVariab leHere, 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.prototyp e.pad...

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

--
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
9436
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 $ Last-Modified: $Date: 2003/10/28 19:48:44 $ Author: A.M. Kuchling <amk@amk.ca> Status: Draft Type: Standards Track
0
1191
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 /home/miallen/Maildir/.Lists.Expat: I would have archived 113 of 116 message(s) in 0.3 seconds /home/miallen/Maildir/.Lists.JCIFS: I would have archived 628 of 1796 message(s) in 4.2 seconds /home/miallen/Maildir/.Lists.Jarapac: I would have archived 0 of 6
3
3573
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 understand the module 'email' and the functions described there to parse email but seems difficult. Can anyone help me in locating some pointers or snippets on this issue.
8
4231
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 variable. It's always going to be as the same column and row position of the block of text. For example, I want to extract the text from the block from say Line 3, column 4 through Line 3, column 15 into a variable.
5
3536
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 look for a component of some sort but had no luck.Any Pointers ? Thanks J
4
1415
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 field: Date: Tue,26 Jul 2005 13:14:27 GMT +0200 It seems to be correct¹, but parsedate_tz is not able to decode it, it is confused by the absence of a space after the ",".
1
2396
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 asking some suggestions and guidence regarding this below code. Still What way I can improve this code. If anyone find error kindly let me know how to correct it.
5
11342
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 variable on which I need to perform log and then divide the result with 3.980. While parsing such expressions, I need to find all occurence of date values and replace "/" character with "~" character. I need to do this only for date portion of the
0
1114
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 docs for the rfc822 module say here: Input lines as read from the file may either be terminated by CR-LF or by a single linefeed; a terminating CR-LF is replaced by a single linefeed before the line is stored.
0
8425
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8845
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.