I hate calling things bugs. I assume this is something I just don't understand.
I have read this thread. http://www.b4x.com/forum/bugs-wishlist/17149-datetime-bug.html#post98040. In that thread at one point last summer, someone said this issue was fixed in a new release. I have version 2.50.
Here is my problem. I have a service which writes a log file with a time stamp every 10 minutes. I then display that timestamp in my activity. It works great.
I have had several travelers cross timezones headed east, and the time stamp jumps an hour when the timezone is crossed and matches the time shown by the clock on the phone. This is perfect.
However, the first traveler has now crossed back through the timezone, headed west, to the point he started (his home). The log continues to be written in the eastern most timezone time, not his local time. The time in the file is exactly 1 hour ahead of the phone clock, I have screen shots. The person started and stopped their journey from the same location. Flew east, stayed a day, flew home. This behavior lasted for 2 days.
He rebooted his phone and now he is back on local time.
Any explanations? Is the following code from the thread listed above really the correct way to get a date, or am I missing something?
I have read this thread. http://www.b4x.com/forum/bugs-wishlist/17149-datetime-bug.html#post98040. In that thread at one point last summer, someone said this issue was fixed in a new release. I have version 2.50.
Here is my problem. I have a service which writes a log file with a time stamp every 10 minutes. I then display that timestamp in my activity. It works great.
B4X:
Dim lastfix As Map
lastfix.Initialize
lastfix.Put("LastFix", DateTime.Date(DateTime.now) & " " & DateTime.Time(DateTime.now))
File.WriteMap(MyAuth.MyFilePath, "LogLastFix.log", lastfix)
I have had several travelers cross timezones headed east, and the time stamp jumps an hour when the timezone is crossed and matches the time shown by the clock on the phone. This is perfect.
However, the first traveler has now crossed back through the timezone, headed west, to the point he started (his home). The log continues to be written in the eastern most timezone time, not his local time. The time in the file is exactly 1 hour ahead of the phone clock, I have screen shots. The person started and stopped their journey from the same location. Flew east, stayed a day, flew home. This behavior lasted for 2 days.
He rebooted his phone and now he is back on local time.
Any explanations? Is the following code from the thread listed above really the correct way to get a date, or am I missing something?
B4X:
d = DateTime.DateParse(DateTime.Date(DateTime.Now))
t = DateTime.TimeParse(DateTime.Time(DateTime.Now))
Log(DateTime.Date(d) & " - " & DateTime.Time(t))
Last edited: