At 08:30 AM 8/16/2007, special_dragonfly wrote:
>Hello,
>
>I need to return the date yesterday in the form DDMM. I looked through
>the modules: time, datetime and calendar but can't find anything that leaps
>out at me.
>
>The problem I'm having is that although I can use time.localtime and get
On Aug 16, 9:46 am, MRAB <[EMAIL PROTECTED]> wrote:
>
> As well as the other replies, this also works (as far as I can tell!):
>
> import time
> today = time.localtime()
> yesterday = today[ : 2] + (today[2] - 1, ) + today[3 : ]
> yesterday = time.localtime(time.mktime(yesterday))
This is somethin
On Aug 16, 4:30 pm, "special_dragonfly" <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I need to return the date yesterday in the form DDMM. I looked through
> the modules: time, datetime and calendar but can't find anything that leaps
> out at me.
>
> The problem I'm having is that although I can use
On Aug 16, 10:54 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> RTFM is the answer...
I don't know. I remember scratching my head for a day or two over the
module explanations and instructions until I found a little howto with
a lot of explicite examples.
http://pleac.sourceforge.net/pleac_
special_dragonfly wrote:
> Hello,
>
> I need to return the date yesterday in the form DDMM. I looked through
> the modules: time, datetime and calendar but can't find anything that leaps
> out at me.
>
> The problem I'm having is that although I can use time.localtime and get a
> tuple of th
On 2007-08-16, Shawn Milochik <[EMAIL PROTECTED]> wrote:
> import time
>
>
> oneDay = 60 * 60 * 24 #seconds in one day
>
> date = time.time()
>
> yesterday = date - oneDay
Or use a timedelta.
>>> import datetime
>>> yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
>>> yesterday.
special_dragonfly schrieb:
> Hello,
>
> I need to return the date yesterday in the form DDMM. I looked through
> the modules: time, datetime and calendar but can't find anything that leaps
> out at me.
>
> The problem I'm having is that although I can use time.localtime and get a
> tuple o
On 8/16/07, special_dragonfly <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I need to return the date yesterday in the form DDMM. I looked through
> the modules: time, datetime and calendar but can't find anything that
> leaps
> out at me.
>
> The problem I'm having is that although I can use time.
import time
oneDay = 60 * 60 * 24 #seconds in one day
date = time.time()
yesterday = date - oneDay
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I need to return the date yesterday in the form DDMM. I looked through
the modules: time, datetime and calendar but can't find anything that leaps
out at me.
The problem I'm having is that although I can use time.localtime and get a
tuple of the year, month, day and so forth, I don'
"Steve Holden" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> import time
> import datetime
>
> dbtd =
> h, m, s = time.localtime()[3:6]
> timenow = s + (60 * (m + 60 * h))
Look like ok, thanks all :)
--
http://mail.python.org/mailman/listinfo/python-list
ian wrote:
> Hi,
>
> i have a problem with time in python.
>
> 1) i got 2 values from mysql db (fields are "time" type)
> 2) python get it as "" (why timedelta???)
timedelta because a time doesn't represent a fixed point until it's
associated w
>
> 1) i got 2 values from mysql db (fields are "time" type)
> 2) python get it as "" (why timedelta???)
> 3) i need to compare 2 fields with actual time ... EG:
> if ArrOutputsAuto[i].TimeFrom >= GNow and ArrOutputsAuto[i].TimeTo
> <= GNow:
>
> i need actual time, and 2 fields from DB in datetim
Hi,
i have a problem with time in python.
1) i got 2 values from mysql db (fields are "time" type)
2) python get it as "" (why timedelta???)
3) i need to compare 2 fields with actual time ... EG:
if ArrOutputsAuto[i].TimeFrom >= GNow and ArrOutputsAuto[i].TimeTo <= GNow
Without your code, it's hard to tell.
Here's a small program I wrote:
import time
t = time.time()
print time.localtime(t - 86400)
print time.localtime(t)
on both lines, the tm_isdst flag is the same.
If I choose two times that are on either side of the DST change in
my timezone,
Hello,
I'm writing a small program that needs to check Unix timestamps for
falling into an interval (typical usage: ./program 2005-03, you get
the idea). Now, I create two time stamps from the user's input to
create the interval's borders using mktime(). Trying to check the sanity
of my program, I
16 matches
Mail list logo