[Techtalk] simple date question

John Clarke johnc+linuxchix at kirriwa.net
Wed Oct 9 03:39:07 UTC 2013


On Tue, Oct 08, 2013 at 07:08:26AM +0000, mgmonza at sdf.lonestar.org wrote:

> However, I was looking for more of a command line thingie, a one-liner
> that could be copied into a .bashrc, like my settime alias.

Have you tried setting the TZ environment variable?  e.g.:

    [johnc at dropbear ~]$ date
    Wed Oct  9 14:35:35 EST 2013
    [johnc at dropbear ~]$ TZ=UTC date
    Wed Oct  9 03:35:35 UTC 2013
    [johnc at dropbear ~]$ TZ=Australia/West date
    Wed Oct  9 11:35:35 WST 2013
    [johnc at dropbear ~]$ TZ=US/Pacific date
    Tue Oct  8 20:35:35 PDT 2013
    [johnc at dropbear ~]$ TZ=America/Los_Angeles date
    Tue Oct  8 20:35:35 PDT 2013

On my Ubuntu system, timezone files are stored in /usr/share/zoneinfo.
Set TZ to the appropriate relative path from there.


- John



More information about the Techtalk mailing list