Odd timezone related behaviour

Advertisement

Ketekk
Joined:
Posts:
1
Location:
Edmonton, AB

Odd timezone related behaviour

By default WinSCP was set to MLSD Auto.
I believe the PLC time is in UTC - unless the timezone / offset is specified.
I am pretty sure that results in file timestamps written in UTC
SO...
The filestamps on the files when examined on the SDcard in Windoze are "correct"
(PLC thinks it is in UTC but is in local time)

When I look at the timestamps displayed by WinSCP, they are all 7 hours earlier
Theoretically the autodetect should take care of it BUT
when I set MLSD to OFF and turn off Detect automatically and specify timezone offset of -7
it makes no difference.
When I set the offset to +7 hours then the time is too far ahead
If I set it to -1 hour then the displayed time is 1 hour too early
So, if I set the offset to 0 then the correct timestamp is displayed.
My guess is that the PLC is schizophrenic about the time it reports when queried and the time it uses to generate timestamps.
My guess is that the autodetect does indeed detect -7 hours but somehow that offset
is NOT applied by WinSCP due to some additional internal logic
Technically, if an offset is explicitly specified, WinSCP should just apply that to all timestamps.
My observation is that they are applied inconsistently
Perhaps the hour cannot be set such that the day is rolled back...
So for a file with a 11:00 AM local timestamp, which appeared as 04:00 filestamp in WinSCP
with default time detection,
If turning off time detection and specifying an explicit 0 hours offset shows the correct time 11:00 then specifying an explicit -7 hours should revert back to showing 04:00
Anyway, I kludged a workable solution but wanted to report what seems like an inconsistency to me... Perhaps I'm confused... It has happened once before ;-)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
42,662
Location:
Prague, Czechia

Re: Odd timezone related behaviour

Please attach a full session log file showing the problem (using the latest version of WinSCP).

Pick one file that we can see in the log and specify what timestamp did you see in WinSCP and what did you expect instead. Thanks.

To generate the session log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum