0
3:root@SERVER:/root # cat wtf.sh
echo "date"
date 
echo "su - root -c date"
su - root -c date
3:root@SERVER:/root # 
3:root@SERVER:/root # ksh wtf.sh
date
Wed Nov  9 13:15:01 MEZ 2016
su - root -c date
Wed Nov  9 12:15:01 UTC 2016
3:root@SERVER:/root # grep TZ /etc/environment
    TZ=MEZ-1MESZ-2,M3.5.0/02:00,M10.5.0/03:00
3:root@SERVER:/root # oslevel -s
6100-09-06-1543
3:root@SERVER:/root # 

Why do they differ?

Even the crontab shows UTC, but the system TZ is MEZ.

1
  • Does root have a profile that sets TZ?
    – Jeff Schaller
    Nov 9, 2016 at 12:35

1 Answer 1

0

Have you changed TZ recently?

When you change TZ with smitty chtz_date it will usually advice you to reboot.

If you simply log off/on - then that session will show you the new TZ. But already running process only know of the old.

All services then needs to be restarted to catch on to the the TZ change. You cannot restart init hence the advice to reboot.

In your case I suspect that it will work if you kill cron and let it restart. This way you can avoid to reboot.

If this is not fixed via a reboot then add echo $TZ to see the variable in each environment you are in.

See also How to change timezone to UTC without rebooting AIX

EDIT: You check for TZ in /etc/environment but you should check if you override it in:

/etc/profile
$HOME/.kshrc
$HOME/.profile

Reference: AIX Korn shell environment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .