Question about strftime

2007-02-10 Thread silverburgh . meryl
Hi,

I have question about strftime.  I am trying to print the current time
in this format:

date = strftime(%Y%m%d_%H%M%S, gmtime())
print date

I run the script at 2:18 pm, but I get this: 20070210_201837

Can you please tell me why I get '20'? instead of '14' (which is 2:00
pm)?

Thank you.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question about strftime

2007-02-10 Thread Paul Rubin
[EMAIL PROTECTED] writes:
 date = strftime(%Y%m%d_%H%M%S, gmtime())
 print date
 
 I run the script at 2:18 pm, but I get this: 20070210_201837
 Can you please tell me why I get '20'? instead of '14' (which is 2:00
 pm)?

Wrong time zone?  Maybe you want localtime() instead of gmtime().
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question about strftime

2007-02-10 Thread Gabriel Genellina
En Sat, 10 Feb 2007 17:29:52 -0300, [EMAIL PROTECTED] escribió:

 I have question about strftime.  I am trying to print the current time
 in this format:

 date = strftime(%Y%m%d_%H%M%S, gmtime())
 print date

 I run the script at 2:18 pm, but I get this: 20070210_201837

 Can you please tell me why I get '20'? instead of '14' (which is 2:00
 pm)?

gmtime() returns the time in UTC, not local time, and your computer thinks  
you're in Mexico, central USA or Canada.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list