Re: help with file timestamp
On Thu, Jul 20, 2000 at 04:04:37PM +1000, Shao Zhang wrote
> Hi,
> I am having some problems here with timestamp. The system is
> hamm.
>
> # date
> Thu Jul 20 15:59:32 EST 2000
>
> # date -u
> Thu Jul 20 05:59:34 UTC 2000
>
> # touch /tmp/hello
> # ls -al /tmp/hello
> -rw-rw-r-- 1 root root 0 Jul 20 05:59 /tmp/hello
>
>
> As you can see /tmp/hello's timestamp is using UTC rather than
> EST. How do I make it using EST?
>
This sounds more like a bug in ls or touch than anything else,
as times in the filesystem will always be recorded as UTC, but
displayed in localtime.
Do you get similar results when you do
$ date -u
$ cat /dev/null > /tmp/hello
$ ls -al /tmp/hello
If not, it looks like touch has problems.
Alternatively, check the "actual" time and filestamp with perl:
$ perl -e 'print time, "\n"'
$ touch /tmp/hello
$ perl -e 'print ((stat("/tmp/hello"))[9], "\n")'
If they produce numbers that correlate well, then it looks like
your ls is displaying dates in UTC, ignoring the timezone that
date uses; could be time to upgrade, if you want to fix it...
John P.
--
huiac@camtech.net.au
john@huiac.apana.org.au
http://www.mdt.net.au/~john Debian Linux admin & support:technical services
Reply to: