mikalhart / TinyGPSPlus

A new, customizable Arduino NMEA parsing library
http://arduiniana.org
1.05k stars 486 forks source link

How to calculate Date and Time in different timezone from TinyGPSPlus class #57

Closed AlexZibin closed 5 years ago

AlexZibin commented 5 years ago

Hi, Thank you for this great library.

Please advise the reliable way to calculate the Date and Time in different timezone.

The example: UTC: Date is 01.01.2019, Time is 23:59 Timezone is 2. I want to receive TZ2: Date is 02.01.2019, Time is 01:59.

My guess is to get raw UTC_seconds, increase them by 24x60x60xTZ, and convert them back to date/time, but I can't find the proper places in your library.

Thank you in advance, I hope that if you will provide this hint, it will be helpful for many users.

PKLoops commented 5 years ago

I have same problem, I need actual local time ( with or without daylight saving ) and local day, for TZ 10, East Coast Australia

Thank you too in advance

bamapookie commented 5 years ago

You might want to look into the time and time zone libraries. https://www.pjrc.com/teensy/td_libs_Time.html https://github.com/JChristensen/Timezone

AlexZibin commented 5 years ago

Wow! Thank you! The problem is solved!