utcnow

Discussion in 'Python' started by Nick the Gr33k, Sep 17, 2012.

  1. 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?
    Nick the Gr33k, Sep 17, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Elizabeth Harmon

    Datetime.UTCNow Problems

    Elizabeth Harmon, Dec 8, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    2,361
    Elizabeth Harmon
    Dec 8, 2004
  2. aspineux
    Replies:
    3
    Views:
    205
    aspineux
    Oct 21, 2011
Loading...

Share This Page