Archived:How to easy handle date and time
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.
All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
Article Metadata
Python doesn't have a decent date/time class. There's a small compatible library from the Python Web Project : datetime. It has been adapted to Python S60 so you can use it and install it as lib.
Here's an example use in command line
import datetime
>>> day = datetime.datetime(2003, 8, 4, 12, 30, 45)
>>> print day
2003-08-04 12:30:45
>>> print repr(day)
datetime.datetime(2003,8,4,12,30,45)
>>> print type(day)
<type 'instance'>
>>> print day.year, day.month, day.day
2003 8 4
>>> print day.hour, day.minute, day.second
12 30 45
>>> print datetime.datetime.now()
link : datetime for Python


20 Sep
2009
25 Sep
2009