System date and file dates not showing in same time zone

System date and file dates not showing in same time zone

Post by Cris Fuhrma » Sun, 21 Jan 2001 03:23:06



Hi,

My Redhat 6.2 system has a peculiar configuration, the system date is
set for EST, but the file dates on "ls -l" appear to have UTC by
default. Look what happens when I do the following (I have edited this
slightly to avoid username info):

-------

$ date
Fri Jan 19 13:06:09 EST 2001
$ touch here
$ ls -l here
-rw-rw-r--   1 xxxx xxxxxx       0 Jan 19 18:06 here
$ date -u
Fri Jan 19 18:06:24 UTC 2001

-------
I have tried changing the UTC=true and UTC=false in
the /etc/sysconfig/clock with no improvement (the file dates and the
default "date" dates are always off by the timezone difference between
UTC and EST).

I have set my "TZ" environement variable in my shell, and that doesn't
seem to help either.

Intuitively the "ls -l" dates should show up in the time zone of the
system, right? How can I set Redhat do be this way.

Thanks,

-Cris

Sent via Deja.com
http://www.deja.com/

 
 
 

System date and file dates not showing in same time zone

Post by Cris Fuhrma » Sun, 21 Jan 2001 04:29:08


I'm replying to my own post with the answer for the benefit of others
who stumble across this one...

The TZ environment variable has to be set to something like "xxxN"
where N is the difference in hours between the local time zone and the
UTC. I have not found the official explanation of why "US/Eastern"
or "America/New_York" are not valid TZ values with respect to ls.
Perhaps the binary I have for ls doesn't support these formats.

-Cris



Quote:> Hi,

> My Redhat 6.2 system has a peculiar configuration, the system date is
> set for EST, but the file dates on "ls -l" appear to have UTC by
> default. Look what happens when I do the following (I have edited this
> slightly to avoid username info):

> -------

> $ date
> Fri Jan 19 13:06:09 EST 2001
> $ touch here
> $ ls -l here
> -rw-rw-r--   1 xxxx xxxxxx       0 Jan 19 18:06 here
> $ date -u
> Fri Jan 19 18:06:24 UTC 2001

> -------
> I have tried changing the UTC=true and UTC=false in
> the /etc/sysconfig/clock with no improvement (the file dates and the
> default "date" dates are always off by the timezone difference between
> UTC and EST).

> I have set my "TZ" environement variable in my shell, and that doesn't
> seem to help either.

> Intuitively the "ls -l" dates should show up in the time zone of the
> system, right? How can I set Redhat do be this way.

> Thanks,

> -Cris

> Sent via Deja.com
> http://www.deja.com/

--

Sr. Software Engineer
ProLogic, Inc. / 1000 Technology Dr.
Fairmont WV 26554

Sent via Deja.com
http://www.deja.com/

 
 
 

1. date/time of a file compare with current date/time

Hi,

I hope i can drop my question about Linux shell programming here?

I'm writing a script in bash to find files. I'm using the slocate
programm, which is being runned every hour using a cron job, to create
it's database.

Now i want to know how long it is ago that the database has been
recreated. Zo i need to check the date and time from that file and
compare it with the current date and time. I know there must be easy to
do but i can't find the trick to do it.

Maikel van Gorkom

Sent via Deja.com http://www.deja.com/
Before you buy.

2. XF86Config for Diamond Stealth VRAM & Nec4FG

3. Archiving files in "date folders" based on date and time file generated

4. SCSI Problems on SS10 w/Centronics connectors

5. run time date and syslog date/time conflict

6. Looking for HP LaserJet 4m PostScript print filter

7. SIMS date and time is not matching with system time

8. sonypi driver updates (PPK keys)

9. System Clock keeps showing the wrong time/date

10. How do I make file creation time same as shown by 'date' command

11. time of file creation only showing date

12. Unix system g77 calls DATE and TIME not working for Alpha/Linux

13. How to set Date/Time zone on Linux?