Being the thoughts and writings of one Gustaf Erikson; father, homeowner, technologist.

This category contains posts about computing, programming, and development

Tuesday, 2005-08-30

Date in another timezone

Cool hack in Unix: if you know the zonefile abbreviation for a timezone, you can use it to get the date there:

$ TZ=PST8PDT date
Tue Aug 30 05:07:39 PDT 2005

This also works:

$ TZ=America/Los_Angeles date
Tue Aug 30 05:08:17 PDT 2005

Timezone files are in /usr/share/zoneinfo on OpenBSD and Linux.

Submit a comment

Please enter comments as plain text only; no HTML tags are allowed. Email or URL are optional.

Comments are closed for this story.