[python] dateutil.relativedelta a posunuti casu.

azurIt azurit na pobox.sk
Sobota Duben 4 11:13:55 CEST 2009


Ahoj,

neviem sice preco pouzivas dateutil (a priznam sa, ze ten modul ani nepoznam) avsak taketo nieco vies predsa urobit priamo s datetime:

>>> start = datetime.datetime(2009, 04, 14, 8, 00)
>>> print start
2009-04-14 08:00:00
>>> end = start + datetime.timedelta(hours=8)
>>> print end
2009-04-14 16:00:00


azur


-----Pôvodná správa-----
Od: [gjaves na gmail.com]
Komu: python na py.cz
Predmet: [python] dateutil.relativedelta a posunuti casu.

Zdravim,

>>> import datetime
>>> import dateutil
>>> import dateutil.relativedelta
>>> start = datetime.datetime(2009, 04, 14, 8, 00)
>>> print start
2009-04-14 08:00:00
>>> end = start + dateutil.relativedelta.relativedelta(hour=+8)
>>> print end
2009-04-14 08:00:00
>>> 

Nemel by mi end vypsat 2009-04-14 16:00:00?

Diky za Vas cas a upresneni tohoto problemu.
 


Další informace o konferenci Python