Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29362

utcnow

Date 2012-09-17 07:25 +0300
From Nick the Gr33k <nikos.gr33k@gmail.com>
Subject utcnow
Newsgroups comp.lang.python
Message-ID <mailman.822.1347855926.27098.python-list@python.org> (permalink)

Show all headers | View raw


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 dayligh savings time?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

utcnow Nick the Gr33k <nikos.gr33k@gmail.com> - 2012-09-17 07:25 +0300
  Re: utcnow Ben Finney <ben+python@benfinney.id.au> - 2012-09-17 14:48 +1000

csiph-web