B4J Question jtelegrambot lib "date" problem

Discussion in 'B4J Questions' started by behnam_tr, Aug 12, 2019.

  1. behnam_tr

    behnam_tr Member

    hi
    @DonManfred

    in jtelegrambot lib
    the "message.date" and "replymessage.date" have a problem


    message.date return int value
    but the int has limit it should long or string

    for example :
    Log("Date:" & message.Date) //int
    Log("system:"&DateTime.Now) //long

    result :
    Date:1565595517 (this is mistake)
    system:1565595522768 (this is correct)
     
  2. DonManfred

    DonManfred Expert Licensed User

    1565595517 <- Seconds
    1565595522768 <- Ticks
     
  3. behnam_tr

    behnam_tr Member

    you mean that i should convert seconds to ticks ??
    how ?? plz give me a sample
     
  4. DonManfred

    DonManfred Expert Licensed User

    Multiply it by 1000
     
    behnam_tr likes this.
  5. emexes

    emexes Well-Known Member Licensed User

    I think what DonManfred meant to write - and given his usual aversion to ambiguity, I was surprised that he didn't - was:

    1565595517 <- Seconds
    1565595522768 <- Milliseconds

    Date and time values are stored as ticks. Ticks are the number of milliseconds since January 1, 1970 00:00:00 UTC

    Within the B4X universe (possibly excluding B4R) ticks == milliseconds.
     
    behnam_tr and DonManfred like this.
  6. emexes

    emexes Well-Known Member Licensed User

    You're right about the limit, though. Gird thy loins for 2038.
     
  7. DonManfred

    DonManfred Expert Licensed User

    behnam_tr likes this.
  8. behnam_tr

    behnam_tr Member

    thanks problem solved with this ;)
     
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