Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Does anyone know how (or if it is possible) to set a separate timezone for different SSH users (or screens)? I am trying to figure out a way to run processes in different time zones, so that the time stamps on the logs are easier to decode, for users in different time zones. I am aware that it is possible to run java processes in a different time zone by launching them with the argument "-Duser.timezone=GMT",

share|improve this question
1  
What logs are you looking at? If they are system logfiles they may not be effected by user's setting the timezone in their .profile as suggested by other users below. –  Brian Swift Apr 2 '12 at 21:23

2 Answers 2

up vote 3 down vote accepted

Just let each user set the timezone they want in their ~/.profile or equivalent login script:

TZ=Japan
export TZ

and in another user's ~/.profile:

TZ=America/Montreal
export TZ
share|improve this answer
    
Thanks so much, that is exactly what I needed! –  DarthCaniac Apr 3 '12 at 0:54

different shells may have different syntaxes, but in bash we just do this:

export TZ="/usr/share/zoneinfo/EST"

go to that directory for a list of timezone names.

share|improve this answer
2  
There is no need to put the full pathname to the timezone database (and it might be in a different location on different systems). Also, standard Olson names are preferred. For example, your example "EST" is ambiguous because it means different timezones in different parts of the world (namely, North America and Australia) –  Celada Apr 2 '12 at 19:48
    
ah ok, thanks. only used to change American (both south and north) TZ info so was not aware of the implications you have mentioned. good to know. –  johnshen64 Apr 2 '12 at 19:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.