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
-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
イェル
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
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
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
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
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
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
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"
>
"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(":")
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 =
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
12 matches
Mail list logo