1

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",

DarthCaniac
  • 209
  • 1
  • 3
  • 8
  • 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 02 '12 at 21:23

2 Answers2

3

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
Celada
  • 6,060
  • 1
  • 20
  • 17
0

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.

johnshen64
  • 5,747
  • 23
  • 17
  • 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 02 '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 02 '12 at 19:55