Time conversion between UTC and local time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • andreas.profous@googlemail.com

    Time conversion between UTC and local time

    Hi all,

    I have the following problem:
    There are strings describing a UTC time, e.g. " 2008-01-15 22:32:30"
    and a string reflecting the time
    zone e.g. "-05:00".

    What is an elegant way of getting the local time (considering DST -
    daylight saving time) with that data?
    The date is not important, just the local time.
    The format is not important, the easiest would probably be a tuple
    (h,m,s) .

    Thanks in advance
  • Jeroen Ruigrok van der Werven

    #2
    Re: Time conversion between UTC and local time

    -On [20080208 15:16], andreas.profous @googlemail.com (andreas.profou s@googlemail.co m) wrote:
    >What is an elegant way of getting the local time (considering DST -
    >daylight saving time) with that data?
    Perhaps using pytz might be the easiest way: http://pytz.sourceforge.net/

    --
    Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org/ asmodai
    イェルーン ラウフロッ ク ヴァン デル ウェルヴェ ン
    http://www.in-nomine.org/ | http://www.rangaku.org/
    But Time, keeps flowing like a river (on and on)...

    Comment

    • Miki

      #3
      Re: Time conversion between UTC and local time

      Hello,
      I have the following problem:
      There are strings describing a UTC time, e.g. " 2008-01-15 22:32:30"
      and a string reflecting the time
      zone e.g. "-05:00".
      >
      What is an elegant way of getting the local time (considering DST -
      daylight saving time) with that data?
      The date is not important, just the local time.
      The format is not important, the easiest would probably be a tuple
      (h,m,s) .


      HTH,
      --
      Miki <miki.tebeka@gm ail.com>
      If it won't be simple, it simply won't be. [Hire me, source code]

      Comment

      Working...