I am trying to use date_time_stamp/2
to get a timestamp for a specific time in specific time zone. My local timezone is CEST, when I try to construct a timestamp in another timezone (let’s say EST) I get:
?- date_time_stamp(date(2020,2,10,2,55,0, Offset, 'EST', D), T).
Offset = -3600, % This is CEST offset
D = false,
T = 1581299700.0.
It seems ‘EST’ was ignored. However, when I do:
?- setenv('TZ', 'EST'), date_time_stamp(date(2020,2,10,2,55,0, Offset, 'EST', D), T).
Offset = 18000,
D = false,
T = 1581321300.0.
It works. It seems that date_time_stamp/2
ignores Timezone (it will unify with any atom), which is strange because that should be used to determine if daylight saving was true or false. Is this a bug or intended behaviour? I’m using swipl v8.1.21.