Remote server uses Local Time instead of UTC

Advertisement

tflynn
Joined:
Posts:
6
Location:
Canada

Remote server uses Local Time instead of UTC

It appears that WinSCP "corrects" for UTC to Local time.
Our (Linux) servers use Local time instead of UTC for time. There is a reason.
We're at UTC -6 hrs.
If I touch a file on a server via say PuTTY, WinSCP will display the file "Changed" with tie stamp plus 6 hours.
Can I configure WinSCP to not add the offset?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
36,035
Location:
Prague, Czechia

Re: Remote server uses Local Time instead of UTC

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

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

tflynn
Joined:
Posts:
6
Location:
Canada

attached 3 files. Winscp log, running ls -l on Linux system & screen shot of WinSCP window. All in a zip file.
For example; WinSCP says time for Patch_4.0.2.sh is 7:21:04, Linux says 13:21 and the session log has T13:21:04.000Z
Time zone offset is -6hrs here.
WinSCP appears to be applying the offset 13-6 = 7.
Can WinSCP be configured to NOT apply offset?

Reply with quote

Advertisement

martin
Site Admin
martin avatar

There's no Patch_4.0.2.sh in this log.
Anyway, if you create a new file on the server (like touch newfile), what time do you see in WinSCP panel? Is it the local current time, or different? Do you think that WinSCP shows wrong time? Or does it show the correct time, but you want WinSCP to display times in server's timezone, instead of local timezone?

Reply with quote

tflynn
Joined:
Posts:
6
Location:
Canada

I thought I had replied to this , but ...
If I touch newfile on the server, I get the current time. But, our server use "local time" as GMT time. for example, on our mobile Linux servers,
the current time (via date) is : Thu Aug 12 13:55:51 GMT 2021. (note GMT)
On Linux "typical" dev machine, date : Thu Aug 12 13:55:51 MDT 2021. (note MDT)
We're in Alberta, so MDT is -6 hr timezone offset.
We've removed the timezones from these mobile Linux servers.
WinSCP will apply the timezone offset to files on the mobile Linux servers.
If I touch newfile, and ls -l, the file will have a time as :Aug 12 14:02.
If I view it via WinSCP, Changed is 8/12/2021 7:02:38 AM.
WinSCP has applied a -6hr offset.
How can I get WinSCp to not apply the offset?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
36,035
Location:
Prague, Czechia

I understand that you are trying (I'm too), but I do not think you have answered my questions.
If I touch newfile, and ls -l, the file will have a time as :Aug 12 14:02.
What timezone?

Can you as unambiguously as possible answer there questions from my previous post?
Is it the local current time, or different? Do you think that WinSCP shows wrong time? Or does it show the correct time, but you want WinSCP to display times in server's timezone, instead of local timezone?

Maybe some screenshots can help.

Reply with quote

tflynn
Joined:
Posts:
6
Location:
Canada

File attached. Contains screen shot and log at debug 2.
Timezone - I'm in Alberta, MDT, timezone offset = -6. The Linux servers are also present in same location. The Linux servers are BeagleBone Blacks running debian.
As seen in screen capture, the server reports the correct time as local time , BUT show GMT.
The local clock time (on the wall) was 9:04.
These servers "don't know their timezone" they think they are in GMT. But we set this to the local time. Generally these servers don't have access to the internet and therefore don't have access to time servers.

Local current time was 9:03 AM (clock on the wall) when I did the touch newfile. I then did a refresh on WinSCP. I then did a screen capture.
Do I think WinSCP shows the wrong time - Yes. It shows 3:03:58 AM. Appears to be local time -6hrs.
I want WinSCP to display time as show on server. 9:03:58 AM in this instance.

It appears WinSCP is detecting the "GMT" on the server and the "MDT" local and adding offset.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
36,035
Location:
Prague, Czechia

So the newfile is 9:03 GMT, what is 3:03 MDT. So WinSCP IS CORRECT.

Do I understand right that you want WinSCP to apply artificial offset of +6 hours to correct your server misconfiguration? WinSCP cannot do that. The SFTP server is required by the specification to report the timestamps in UTC, what your server fails to do, because it's misconfigured.

As a workaround, you might switch to SCP. With SCP protocol, you can configure the artificial offset:
https://winscp.net/eng/docs/ui_login_environment

Reply with quote

Advertisement

You can post new topics in this forum