datetime question

Νίκος Αλεξόπουλος nikos.gr33k at gmail.com
Mon Nov 11 10:57:36 CET 2013


Στις 8/11/2013 11:11 μμ, ο/η Νίκος Αλεξόπουλος έγραψε:
> Is there someway to write the following line even better with the
> ability to detect daylight saving time by itself so i don't have to
> alter the line manually when time changes?
>
> lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
> '%y-%m-%d %H:%M:%S' )        # MySQL datetime format
>
> Thanks.


Someone has an idea what to add to this line to automatically adjust 
itself if DST happens?



More information about the Python-list mailing list