Vlastne som zistil az teraz ze to ide.
Predtym som to robil otrocky, t.j. prevadzal som datum do ciselneho formatu yyyymmdd
>>> datum_1=time.strptime('18.1.2006', "%d.%m.%Y")
>>> datum_2=time.strptime('18.03.2006', "%d.%m.%Y")
>>> datum_1_int = string.atoi(time.strftime("%Y%m%d",datum_1))
>>> datum_2_int = string.atoi(time.strftime("%Y%m%d",datum_2))
>>> datum_1_int
20060118
>>> datum_2_int
20060318

--ale zato moze COBOL..:-)





Leos Pol <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

20.10.2006 12:22

Please respond to
Konference PyCZ <python@py.cz>

To
Konference PyCZ <python@py.cz>
cc
Subject
Re: [python] Převod datumu a času





Roman Miklos wrote:
>
> Ono to ide aj s tou Blazenkou, alebo sa mylim?
>
> >>> datum_1=time.strptime('18.1.2006', "%d.%m.%Y")
> >>> datum_2=time.strptime('18.03.2006', "%d.%m.%Y")
> >>> datum_1 < datum_2
> True
> >>> datum_2 < datum_1
> False
>
> >>>#reprezentacia datumov
> >>> datum_1
> (2006, 1, 18, 0, 0, 0, 2, 18, -1)
> >>> datum_2
> (2006, 3, 18, 0, 0, 0, 5, 77, -1)
> >>>
>
Proto jsem pouzil to same uz v moji reakci.
Leo

BTW: pro tento email jsem pouzil -> Send in Plain Text only
_______________________________________________
Python mailing list
Python@py.cz
http://www.py.cz/mailman/listinfo/python


Mgr. Ing. Roman MIKLÓŠ
Prvá stavebná sporiteľňa a.s.
Bajkalská 30, P. O. Box 48
829 48  Bratislava 25
Tel.: +421/ 2 / 582 31 174
Fax: +421/ 2 / 582 31 109
_______________________________________________
Python mailing list
Python@py.cz
http://www.py.cz/mailman/listinfo/python

Odpovedet emailem