datetime issue

Νικόλαος Κούρας nikos.gr33k at gmail.com
Sun Sep 16 04:18:11 EDT 2012


Τη Κυριακή, 16 Σεπτεμβρίου 2012 10:51:18 π.μ. UTC+3, ο χρήστης Νικόλαος Κούρας έγραψε:
> dn = datetime.datetime.now()
> 
> dd = datetime.timedelta(hours=2)
> 
> date = dn + dd
> 
> date = date.strftime( '%y-%m-%d %H:%M:%S' )
> 
> 
> 
> still giving me texas,us time for some reason

which is same as this:

date = ( datetime.datetime.now() + datetime.timedelta(hours=2) ).strftime( '%y-%m-%d %H:%M:%S')

this also doesnt work either:

date = ( datetime.datetime.now(hours=2).strftime( '%y-%m-%d %H:%M:%S')

if only it would!



More information about the Python-list mailing list