Android Question [B4X] convert UTC ticks to local time ticks

Discussion in 'Android Questions' started by Alexander Stolte, Aug 8, 2019.

  1. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User


    from my PostgreSQL-Server i receive UTC-Time-Ticks, how can i convert this ticks to the local time ticks?

    I have searched in the Forum, but i dont found the right solution...

  2. emexes

    emexes Well-Known Member Licensed User

    DateTime.Now ticks are always UTC. When you use DateTime.Time to get a human-readable string representation of the Long ticks number, it will convert it to the device's local timezone. You can include the letter Z in the DateTime.TimeFormat to check the current timezone offset being used for that conversion.

    A useful site for comparing your local DateTime.Now ticks value to UTC, and for doing conversion between local and UTC times (in both directions) is:
  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