Dateadd?
#1
anybody knows if there is a dateadd command in python?
Reply
#2
dateadd?

what should that function/command do?
Reply
#3
i mean getting a date with an offset. in sql you can use dateadd(hour,getdate(),-5) which would give you time now -5 hours. i'm looking for something similar.
Reply
#4
what i would use is time.localtime()

see http://www.python.org/doc/2.4.1/lib/module-time.html for more info.

cheers
cacti
Reply
#5
have a look at the datetime python module. in particular datetime.timedelta is useful for what you want to do. for example:

Quote:starttime = self.starttime - datetime.timedelta( hours=delta )
Reply
#6
this is exactly what i was looking for.

thanks :thumbsup:
Reply

Logout Mark Read Team Forum Stats Members Help
Dateadd?0