×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    2

    appuifw.query('', 'date')

    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

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Tempe, AZ
    Posts
    411

    Re: appuifw.query('', 'date')

    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.

  3. #3
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Kuopio, Finland
    Posts
    50

    Re: appuifw.query('', 'date')

    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)

  4. #4
    Registered User
    Join Date
    May 2008
    Posts
    2

    Re: appuifw.query('', 'date')

    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 14:03.

Similar Threads

  1. Date & Time Editor in Form Resource.
    By Kavit Patel in forum Symbian C++
    Replies: 2
    Last Post: 2008-03-03, 06:26
  2. Issue with slow date operations on N95
    By redsmurph in forum Mobile Java General
    Replies: 8
    Last Post: 2007-12-24, 17:15
  3. preverify error. PLZ HELP
    By michaelhann89 in forum Mobile Java Tools & SDKs
    Replies: 14
    Last Post: 2007-03-22, 22:51
  4. EXIF Date Picture Taken missing for 6288
    By macmiller in forum General Development Questions
    Replies: 1
    Last Post: 2007-03-11, 21:37
  5. Date format...!!!
    By palak_shah_23 in forum Symbian C++
    Replies: 4
    Last Post: 2006-09-07, 07:27

Posting Permissions

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