datetime question

Νίκος Αλεξόπουλος nikos.gr33k at
Fri Nov 8 22:11:02 CET 2013

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


More information about the Python-list mailing list