Recent

Author Topic: How get timezone information in Lazarus on Android  (Read 1307 times)

las

  • New Member
  • *
  • Posts: 26
How get timezone information in Lazarus on Android
« on: May 16, 2019, 11:35:51 pm »
Hi!
Help me, please, how to get local time.

The "Now" and "systemtimetodatetime" functions return UTC time.

How to find out the current TimeZone?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: How get timezone information in Lazarus on Android
« Reply #1 on: May 17, 2019, 01:22:28 am »

You can try:

Code: Pascal  [Select][+][-]
  1. ...........................
  2. var
  3.    dateTime: string;
  4. begin
  5.    ...............
  6.    dateTime:= Self.GetDateTime();  //yyyy-MM-dd HH:mm:ss
  7.    ....................
  8. end;
  9.  

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

las

  • New Member
  • *
  • Posts: 26
Re: How get timezone information in Lazarus on Android
« Reply #2 on: May 17, 2019, 01:27:12 am »
Thanks. It work

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: How get timezone information in Lazarus on Android
« Reply #3 on: May 17, 2019, 01:31:02 am »
GetSystemTime
SystemTimeToTzSpecificLocalTime
TTimeZoneInformation
GetTimeZoneInformationForYear

// Windows only ...  :)
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

 

TinyPortal © 2005-2018