datetime question

Mark Lawrence breamoreboy at
Fri Nov 8 22:29:22 CET 2013

On 08/11/2013 21:11, Νίκος Αλεξόπουλος wrote:
> 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.

Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

More information about the Python-list mailing list