| Reply | « Previous Thread | Next Thread » |
|
Hi Guys,
please help little I have a problem with the data returned by the query input for date/time query types.nd2=appuifw.query('', 'date') + appuifw.query('', 'time') (date: 12/05/2008, time: 03:45) nd2 => 1210556700.0 >>> time.localtime(1210556700) (2008, 5, 12, 1, 45, 0, 0, 133, -1) >>> time.gmtime(1210556700) (2008, 5, 11, 22, 45, 0, 6, 132, -1) Any idea where these 2 hours go ?(Phone clock settings- GMT+3:00, daylights saving) Using PythonForS60_1_4_3_2ndEd |
| executable |
| View Public Profile |
| Find all posts by executable |
|
As far as i got your problem, there is no problem at all
![]() time.localtime() shows the time on your computer. time.gmtime() shows the equivalent time at GM (Greenwich Mean Time). Like my computer at the moment gives this (2008, 5, 12, 11, 21, 45, 0, 133, 0) for time.localtime() & this (2008, 5, 12, 5, 52, 3, 0, 133, 0) for time.gmtime() which is correct as here universal time is GM + 5:30. And ya welcome to Forum. IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
Quote:
3rd gives correct times, but 2rd does not. So it looks that it is a timezone issue with 2rd. If I set the 2rd timezone to +1 I get correct local and GMT times (but the time in seconds is not same as with 3rd) My test script and results. import time, appuifw print u'\n\n' nd2=appuifw.query(u'Date?', 'date') + appuifw.query(u'Time', 'time') print u'Given time in sec.',nd2 print u'Given time local',time.localtime(nd2) print u'Given time GMT', time.gmtime(nd2) Results with (date: 12/05/2008, time: 03:45): E90 3rd (correct) Given time in sec. 1210553100.0 Given time local (2008,5,12,3,45,0,0,133,-1) Given time GMT (2008,5,12,0,45,0,0,133,-1) 3230 2rd (wrong) Given time in sec. 1210556700.0 Given time local (2008,5,12,1,45,0,0,133,-1) Given time GMT (2008,5,11,22,45,0,6,132,-1) |
|
Hi shubhendra,
time.localtime() and time.gmtime() does return the correct values but when using appuifw.query('', 'date') the returned value is wrong when trying to decode it using time.localtime/gmtime(seconds) Quote:
The only solution for 2nd ed that i can think off for now is: nd2=appuifw.query(u'Date?', 'date') + appuifw.query(u'Time', 'time') + abs(time.altzone) print u'Given time in sec.',nd2 print u'Given time local',time.localtime(nd2) print u'Given time GMT', time.gmtime(nd2) with disabled day light savings. Any other ideas plz share ?
Last edited by executable : 2008-05-12 at 15:03.
|
| executable |
| View Public Profile |
| Find all posts by executable |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Date & Time Editor in Form Resource. | Kavit Patel | General Symbian C++ | 2 | 2008-03-03 07:26 |
| Issue with slow date operations on N95 | redsmurph | Mobile Java General | 8 | 2007-12-24 18:15 |
| preverify error. PLZ HELP | michaelhann89 | Mobile Java Tools & SDKs | 14 | 2007-03-22 23:51 |
| EXIF Date Picture Taken missing for 6288 | macmiller | General Discussion | 1 | 2007-03-11 22:37 |
| Date format...!!! | palak_shah_23 | General Symbian C++ | 4 | 2006-09-07 08:27 |