Nick the Gr33k writes:
> Hello is there a better way of writing this:
>
> date = ( datetime.datetime.utcnow() + datetime.timedelta(hours=3)
> ).strftime( '%y-%m-%d %H:%M:%S')
>
> something like:
>
> date = datetime.datetime.utcnow(hours=3).strftime( '%y-%m-%d %H:%M:%S')
>
> i prefer it if it coul
Time zones! So much fun. Looks like you're dealing with UTC offsets
yourself, which gets messy as soon as you start thinking about DST. The
good news is that there's a timezone database on most systems, which you
should almost definitely use.
Take a look at python-dateutil (pip install python-date
Hello is there a better way of writing this:
date = ( datetime.datetime.utcnow() + datetime.timedelta(hours=3)
).strftime( '%y-%m-%d %H:%M:%S')
something like:
date = datetime.datetime.utcnow(hours=3).strftime( '%y-%m-%d %H:%M:%S')
i prefer it if it could be written as this.
Also what about