Diff for /wikisrc/tutorials/how_to_set_up_per-user_timezones.mdwn between versions 1.1 and 1.2

version 1.1, 2011/11/20 20:55:21 version 1.2, 2012/02/05 07:14:36
Line 1 Line 1
 Besides setting up the global system timezone by symlinking `/etc/localtime`  Besides setting up the global system timezone by symlinking `/etc/localtime`
 to a file in `/usr/share/zoneinfo`, you can also set a timezone that applies  to a file in `/usr/share/zoneinfo`, you can also set a timezone that applies
 only for one user. This is done by setting the environment variable `TZ`.  only for one user. This is done by setting the environment variable `TZ`.
   
 You can set it in your startup file like this:  You can set it in your startup file like this:
   
          
     $ echo 'export TZ=Europe/Amsterdam' >> ~/.profile      $ echo 'export TZ=Europe/Amsterdam' >> ~/.profile
          
   
 From this shell all subsequent [date] calls will use the  From this shell all subsequent [date] calls will use the
 `/usr/share/zoneinfo/Europe/Amsterdam` file for translating the system's UTC  `/usr/share/zoneinfo/Europe/Amsterdam` file for translating the system's UTC
 time to your local time.  time to your local time.
   
 To run a single process with a specific timezone, try something like this:  To run a single process with a specific timezone, try something like this:
   
          
     $ env TZ=Canada/Eastern xclock -d -strftime "Toronto: %a, %d %b, %H:%M" &      $ env TZ=Canada/Eastern xclock -d -strftime "Toronto: %a, %d %b, %H:%M" &
          
   
 This will start an environment with the TZ variable set to Canada/Eastern, and  This will start an environment with the TZ variable set to Canada/Eastern, and
 run a digital (-d) xclock with the time formatted as instructed by -strfime,  run a digital (-d) xclock with the time formatted as instructed by -strfime,
 including putting a note about which timezone it belongs to ("Toronto"). This  including putting a note about which timezone it belongs to ("Toronto"). This
 process will detach from the terminal (because of the &), but leave the  process will detach from the terminal (because of the &), but leave the
 environment you ran it from with the same timezone it began with. With a setup  environment you ran it from with the same timezone it began with. With a setup
 like this, one can run an xclock (or many xclocks) displaying the localtime of  like this, one can run an xclock (or many xclocks) displaying the localtime of
 various timezones around the world.  various timezones around the world.
   
 ##  References  ##  References
   
   * [environ(7)](http://netbsd.gw.com/cgi-bin/man-cgi?environ+7+NetBSD-current)    * [environ(7)](http://netbsd.gw.com/cgi-bin/man-cgi?environ+7+NetBSD-current)

Removed from v.1.1  
changed lines
  Added in v.1.2


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb