You Are Here:

Community: Developer Discussion Boards

#1 Old appuifw.query('', 'date') - 2008-05-12, 02:50

Join Date: May 2008
Posts: 2
executable
Offline
Registered User
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
Reply With Quote

#2 Old Re: appuifw.query('', 'date') - 2008-05-12, 07:53

Join Date: Dec 2007
Posts: 409
Location: Tempe, AZ
Send a message via Yahoo to shubhendra Send a message via Skype™ to shubhendra
shubhendra's Avatar
shubhendra
Offline
Forum Nokia Champion
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.
Reply With Quote

#3 Old Re: appuifw.query('', 'date') - 2008-05-12, 09:41

Join Date: Dec 2007
Posts: 50
Location: Kuopio, Finland
ilpo55
Offline
Regular Contributor
Quote:
Originally Posted by executable View Post
Hi Guys,
please help little I have a problem with the data returned by the query input for date/time query types.
I tested the same thing with 3rd Ed. (Nokia E90) and 2rd Ed. (Nokia 3230).
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)
Reply With Quote

#4 Old Re: appuifw.query('', 'date') - 2008-05-12, 13:54

Join Date: May 2008
Posts: 2
executable
Offline
Registered User
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:
Originally Posted by shubhendra View Post
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.


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.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia