I have a date as string coming from a GPS system that need to be represented with the timezone and daylight saving settings.
This is the code that works fine
The problem in the example above is that the original date "2018-03-25 02:01:22" does not exist in Italy (on 25 March the hour jumps from 02:00 to 03:00) and that code crash with "unparseable date"
Where I'm wrong ?
This is the code that works fine
B4X:
Dim dt As Long=DateTime.Dateparse("2018-03-25 02:01:22")
dt=dt+(DateTime.GetTimeZoneOffsetAt(dt)*3600000)
Log(DateTime.Date(dt))
The problem in the example above is that the original date "2018-03-25 02:01:22" does not exist in Italy (on 25 March the hour jumps from 02:00 to 03:00) and that code crash with "unparseable date"
Where I'm wrong ?