Different timestamps in SFTP "ls -l" vs. "ls -lh"
8
votes
1
answer
3639
views
I have a 3rd-party SFTP server on which I want to check some file timestamps.
However, I do get different results for the same file if I use
ls -l
vs. ls -lh
:
sftp> ls -l
[...]
-rwxrwxrwx 1 0 0 1963 Nov 15 08:49 foo.txt
[...]
sftp> ls -lh
[...]
-rwxrwxrwx 0 0 0 1.9K Nov 15 07:49 foo.txt
[...]
sftp> ls -l foo.txt
-rwxrwxrwx 0 0 0 1963 Nov 15 07:49 foo.txt
sftp> ls -lh foo.txt
-rwxrwxrwx 0 0 0 1.9K Nov 15 07:49 foo.txt
As you can see, the timestamp in ls -l
is 08:49
whereas the other commands have 07:49
. The server is in Germany which currently is 1h later than UTC, so my guess is that 07:49
is UTC whereas 08:49
is Berlin time.
However, my machine is on UTC:
$ cat /etc/timezone
Etc/UTC
My understanding is that, according to the SFTP standard, all timestamps should be in UTC. However I'm not sure whether that understanding is correct (given that there are so many different versions of the standard). I also don't know whether the sftp
tool somehow postprocesses the timestamps (man sftp
doesn't mention timezones or timestamps at all).
What could be the reason for the difference?
Asked by Florian Brucker
(1017 rep)
Nov 15, 2021, 09:20 AM
Last activity: Mar 25, 2024, 02:54 PM
Last activity: Mar 25, 2024, 02:54 PM