This is working fine on Mac OS but when I build and move it to Linux (Ubuntu 14.04 LTS), the timezone does not affect the outcome. Is this a known bug? Plus, I am not able to create a feedback case. The option is disabled.
Xojo WE 2017, Release 3
[code]Public Function DateSecondsToXojoDate(dateSeconds As Int64, Optional offset As Integer) as xojo.Core.Date
Using Xojo.Core
Dim tz As New Xojo.Core.TimeZone(“GMT”)
if offset <> 0 then tz = New Xojo.Core.TimeZone(offset * 3600)
Dim d As New Xojo.Core.Date(dateSeconds, tz)
Dim m As String = "dateSeconds = " + dateSeconds.ToText + ", offset = " + offset.ToText
m = m + Chr(10) + " tz.current"
m = m + Chr(10) + " abbreviation = " + tz.Current.Abbreviation
m = m + Chr(10) + " secondsfromgmt = " + tz.Current.SecondsFromGMT.ToText
m = m + Chr(10) + " tz"
m = m + Chr(10) + " abbreviation = " + tz.Abbreviation
m = m + Chr(10) + " secondsfromgmt = " + tz.SecondsFromGMT.ToText
m = m + Chr(10) + " d"
m = m + Chr(10) + " date = " + d.ToText
m = m + Chr(10) + " secondsfromgmt = " + d.SecondsFrom1970.ToText
m = m + Chr(10) + " timezone = " + d.TimeZone.Abbreviation
m = m + Chr(10) + " secondsfromgmt = " + d.TimeZone.SecondsFromGMT.ToText
LogToFile(0, CurrentMethodName, m)
Return d
End Function
[/code]
Results on Mac OS
[quote][1514218965] 0, modDate.DateSecondsToXojoDate, dateSeconds = 1511053408, offset = 0
tz.current
abbreviation = America/Denver
secondsfromgmt = -25200
tz
abbreviation = GMT
secondsfromgmt = 0
d
date = 2017-11-19 01:03:28
secondsfromgmt = 1511053408.000000
timezone = GMT
secondsfromgmt = 0
[1514218965] 0, modDate.DateSecondsToXojoDate, dateSeconds = 1511053408, offset = -7
tz.current
abbreviation = America/Denver
secondsfromgmt = -25200
tz
abbreviation = GMT-0700
secondsfromgmt = -25200
d
date = 2017-11-18 18:03:28
secondsfromgmt = 1511053408.000000
timezone = GMT-0700
secondsfromgmt = -25200
[/quote]
Results on Linux
[quote][1514219119] 0, modDate.DateSecondsToXojoDate, dateSeconds = 1514097550, offset = 0
tz.current
abbreviation = Navajo
secondsfromgmt = -21600
tz
abbreviation = Etc/GMT
secondsfromgmt = 0
d
date = 2017-12-24 06:39:10
secondsfromgmt = 1514097550.000000
timezone = Etc/GMT
secondsfromgmt = 0
[1514219119] 0, modDate.DateSecondsToXojoDate, dateSeconds = 1514097550, offset = -7
tz.current
abbreviation = Navajo
secondsfromgmt = -21600
tz
abbreviation = Etc/Unknown
secondsfromgmt = -25200
d
date = 2017-12-24 06:39:10
secondsfromgmt = 1514097550.000000
timezone = Etc/Unknown
secondsfromgmt = -25200[/quote]