Re: Time conversion between UTC and local time

2008-02-08 Thread Miki
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 i

Re: Time conversion between UTC and local time

2008-02-08 Thread Jeroen Ruigrok van der Werven
-On [20080208 15:16], [EMAIL PROTECTED] ([EMAIL PROTECTED]) 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 イェル

Time conversion between UTC and local time

2008-02-08 Thread andreas . profous
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

Re: stftime %z time conversion character

2007-06-20 Thread sergio
d to convert times > that use this convention to python time representations, and because > Python does not support the %z time conversion character I cannot > simply use the time.strptime function. > > What solutions have people used for this? I'm currently thinking of > c

Re: stftime %z time conversion character

2007-06-19 Thread Evan Klitzke
FC 2822 dates/times, and is > > used by a number of other programs as well. I need to convert times > > that use this convention to python time representations, and because > > Python does not support the %z time conversion character I cannot > > simply use the time.strptime funct

Re: stftime %z time conversion character

2007-06-19 Thread Paul Boddie
d to convert times > that use this convention to python time representations, and because > Python does not support the %z time conversion character I cannot > simply use the time.strptime function. See this patch for an idea of the scope of this problem: https://sourceforge.net/tracker/?fu

stftime %z time conversion character

2007-06-19 Thread Evan Klitzke
convention to python time representations, and because Python does not support the %z time conversion character I cannot simply use the time.strptime function. What solutions have people used for this? I'm currently thinking of creating a dict that maps four digit time offsets to the time zone name and

Re: time conversion

2005-10-27 Thread Steven D'Aprano
On Thu, 27 Oct 2005 14:36:30 +, flupke wrote: > Is there an easy to convert following hour notation hh:mm > to decimals? > For instance 2 hours and 30 minutes as 2:30 to 2,50 > I don't really know where to search for this kind of conversion. def str_HMS(s): """Convert a string "H:M:S" to

Re: time conversion

2005-10-27 Thread flupke
Fredrik Lundh wrote: > "flupke" wrote: > > >>Is there an easy to convert following hour notation hh:mm >>to decimals? >>For instance 2 hours and 30 minutes as 2:30 to 2,50 >>I don't really know where to search for this kind of conversion. > > > you mean like > > >>> timestamp = "2:30" >

Re: time conversion

2005-10-27 Thread Fredrik Lundh
"flupke" wrote: > Is there an easy to convert following hour notation hh:mm > to decimals? > For instance 2 hours and 30 minutes as 2:30 to 2,50 > I don't really know where to search for this kind of conversion. you mean like >>> timestamp = "2:30" >>> hour, minute = timestamp.split(":")

Re: time conversion

2005-10-27 Thread flupke
flupke wrote: > Is there an easy to convert following hour notation hh:mm > to decimals? > For instance 2 hours and 30 minutes as 2:30 to 2,50 > I don't really know where to search for this kind of conversion. > > Thanks, > Benedict I found a way. Not sure if it's the best: time = "2:3" factor =

time conversion

2005-10-27 Thread flupke
Is there an easy to convert following hour notation hh:mm to decimals? For instance 2 hours and 30 minutes as 2:30 to 2,50 I don't really know where to search for this kind of conversion. Thanks, Benedict -- http://mail.python.org/mailman/listinfo/python-list