RFC 2822 format date printing function in python

P

praba kar

Dear All,

In Php we can print RFC 2822 formatted date by
date('r') with parameter r. Then it will print the
below format date.
"Thu, 7 Apr 2005 01:46:36 -0300".
I want to print same RFC 2822 format in python. Is it
possible in python? . If possible kindly mention the
function related to print RFC format date

regards,
Prabahar

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
 
G

George Yoshida

praba said:
> In Php we can print RFC 2822 formatted date by
> date('r') with parameter r. Then it will print the
> below format date.
> "Thu, 7 Apr 2005 01:46:36 -0300".
> I want to print same RFC 2822 format in python. Is it
> possible in python? . If possible kindly mention the
> function related to print RFC format date
>

Not as simple as PHP, but of course it's possible :)
'Fri, 06 May 2005 18:00:20 +0900'

http://docs.python.org/lib/module-email.Utils.html

If you want to do the same thing with time module, you need a few
more lines to calcualate the timezone.

quote from footnote:

Note that the sign of the timezone offset is the opposite of the
sign of the time.timezone variable for the same timezone; the
latter variable follows the POSIX standard while this module
follows RFC 2822.


http://docs.python.org/lib/module-time.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top