Android Question Datetime.time BUG

Discussion in 'Android Questions' started by RuudS, Mar 10, 2015.

  1. RuudS

    RuudS New Member

    Hi All,

    I live within the timezone GMT+1, When i calc 850 seconds with the Datetime.time function it gives one hour extra.

    Look at this code :

    Dim u_sec, u_min, u_hour
    u_sec = Floor( 850 Mod 60 )
    u_min = Floor( 850 / 60 Mod 60 )
    u_hour = Floor( 850 / 3600 Mod 24 )
    Log( u_hour & " " & u_min & " " & u_sec )
    Log( DateTime.Time( DateTime.TicksPerSecond * 850 ) )

    Is this timezone related perhaps ? Has someone else encouterd this problem in the past ?

    Greetz Ruud
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. RuudS

    RuudS New Member

    Erel,

    01/01/1970 00:14:10 = 850 secs * ticksPerSec

    Datetime.date( 850 * ticksPerSec ) should give "1/1/1970" and it does
    Datetime.time( 850 * ticksPerSec ) should give "00:14:10" and not "01:14:10"

    Strange, why is one hour added ?

    The function you provided works - ty!
     
    Last edited: Mar 10, 2015
  4. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice