Operating System - HP-UX
1833376 Members
3102 Online
110052 Solutions
New Discussion

Regarding cron and timezone

 
SOLVED
Go to solution
vind123
Regular Advisor

Regarding cron and timezone

1. In my system under scp user i am able to find the below details
>cat /etc/TIMEZONE
TZ=CST0
export TZ
>echo $TZ
CST0
>date
Thu Aug 3 09:30:53 CST 2006
>date -u
Thu Aug 3 09:30:56 UTC 2006

Does CST0 means GMT time? Because date -u and date are giving the same time. If TZ=CST6CDT is set only does it mean central time?


2. Will the root id and other unix user id run under same timezone. In which timezone cron runs and how it is decided for each unix user id?
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Regarding cron and timezone

CST0 would indicate an offset of 0 from UTC so in that sense the times indicated would be the same although the timezones as displayed by strftime would be CST rather than UT, GMT, or UTC for example.

TZ=CST6CDT does conform to the standard definition of Central Time (US).

HP-UX adds a wrinkle in that the behavior of a given TZ can be modified by the contents of a textfile, /usr/lib/tztab. Have a look at this file and the tztab man page.


2. Yes, no, maybe. The default TZ is set by sourcing the the /etc/TIMEZONE but this can be overridden by defining an entry in the user's .profile (or for that matter defining TZ later). It's perfectly legal (and quite common) for a UNIX box to have users logged in from all over the planet -- each with a unique TZ setting.

By the way, a useful way to briefly define an environemt variable is this:

TZ=CST0date
TZ=CST6CDT date
If it ain't broke, I can fix that.
Peter Nikitka
Honored Contributor

Re: Regarding cron and timezone

Hi,

1. nothing to add to Clay's response

2. If an account has a different timezone to the one that is set in the cron environment, the setting of the correct schedule time is subject to test - my Home Linux SuSE9.3 does not handle this gracefully for differences greater than 3 hours.

If no different timezones are in play (daylight saving is not considered as a different timezone in this context), cron and the user running a crontab command live in the same timezone.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
vind123
Regular Advisor

Re: Regarding cron and timezone

1. Does root userid and all the other userid's will take the TZ value under /etc/TIMEZONE and run the crontab under each user id?
2. If TZ is set in the .profile, then when i login into the system with particular user id only it will executed. Then when i logoff from the system TZ system will go away. How does the unix system will store the TZ value and continue to run under the same timezone for the particular user id if logoff from the system?

vind123
Regular Advisor

Re: Regarding cron and timezone

Thanks a lot for the info