Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to change date result from UTC to EDT?

69 views
Skip to first unread message

Donald Li

unread,
Apr 21, 2003, 4:29:41 PM4/21/03
to
My box runs RH 7.1. Date command has this result:

$ date
$ Mon Apr 21 16:20:25 UTC 2003

I'm in Philadelphia (New York time zone). I tried timeconfig
command, it didn't allow me to change UTC to EDT. Since you
can "date --utc" to set it to UTC format, I tend to believe
there must be some way to change it the other way besides a
reinstall. However, I couldn't find any clue from date man
page. Has anybody ever done it before? Thank you for your
attention.


-Donald Li
Dept. of Physics
Univ. of Penn.

Julian Bradfield

unread,
Apr 21, 2003, 4:54:19 PM4/21/03
to
man -k timezone

# rm /etc/localtime
# ln -s /usr/share/zoneinfo/EST5EDT /etc/localtime

If, for some reason, you don't have root on this box, then
TZ=EST5EDT export TZ
in your shell.
I'm pretty sure the RH7.1 date manpage mentions both TZ and
/etc/localtime.

renrutv

unread,
Apr 21, 2003, 6:10:17 PM4/21/03
to

I have an out of the box install or Redhat 9.0. When I issue the date
command I see EDT:

[root@bd sysconfig]# date
Mon Apr 21 18:00:46 EDT 2003

This appears to be controlled by
/etc/sysconfig/clock :

[root@bd sysconfig]# cat clock
ZONE="America/New_York"
UTC=false
ARC=false

You could probably get away with simply editing this file (as root of
course). Make a copy of the original just in case (who knows, but always
a good policy).

The configuration files in /etc/sysconfig are normally read during
startup, so you'll probably need to cycle your computer for the
changes to be picked up, unless you can find a script or command that
will dynamcially read this file.

Donald Li

unread,
Apr 22, 2003, 10:48:15 AM4/22/03
to
"renrutv" <ren...@yahoo.com> wrote in message news:<pan.2003.04.21...@yahoo.com>...

I got this problem solved by testing different approaches. What I did
was edit /etc/bashrc and add "TZ=America/New_York export TZ". This is
similar to Jilian's second suggestion. I also tried Julian's first
suggestion, it also worked.

Before posting for help, I'd played with /etc/sysconfig/clock, but it
didn't work for me.

Anyway, thank you guys for help.

0 new messages