| Reply | « Previous Thread | Next Thread » |
|
In Python for S60, is it possible convert a date object, from a query or a form, to a string ?
If possible, how to do it ? Thanks |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
Yes, you can convert a date to a string using a query/form. For example: Code:
import appuifw date = appuifw.query(u"Type a date:", "date") In this case, 'date' variable will be what the user typed in the query, that will be already set for a date input ![]() Hope it helps, Rafael.
Last edited by Rafael T. : 2008-10-31 at 00:18.
|
|
But, if I use that code in a query with, for instance, today's date, it prints the string '1225324800.0'
What's wrong ? |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
||
|
Quote:
You're right. It returns this big numbers because they are displayed in seconds ![]() From Python Library Reference: Quote:
![]() BR, Rafael. |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
See localtime([secs]) and then strftime(format[, t]) here.
|
|
Problem solved.
Thank you. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Starting a new Active Object from a existing Active Object | A.Vogel | General Symbian C++ | 4 | 2007-11-26 14:41 |
| How 2 chk TTime object contains date & time in correct format | sameer.chaudhari | General Symbian C++ | 6 | 2007-09-28 06:36 |
| Page builder | giogiogio | Python | 2 | 2007-08-26 19:08 |
| preverify error. PLZ HELP | michaelhann89 | Mobile Java Tools & SDKs | 14 | 2007-03-22 23:51 |
| convert Date object to string | artemg | Mobile Java General | 4 | 2006-03-03 05:56 |