GNU date can display different times tha ... / 2013-01-02 - Koos van den Hout

2013-01-02 4 years ago
GNU date can display different times than the current time, with the -d or --date parameter:
  -d, --date=STRING         display time described by STRING, not `now'
But with a bit of experimenting I found out I can use this for calculating times in other timezones too:
koos@greenblatt:~$ date --date=20:00\ UTC
Wed Jan  2 21:00:00 CET 2013
koos@greenblatt:~$ date --date=20:00\ US/Central
date: invalid date `20:00 US/Central'
koos@greenblatt:~$ date --date=20:00\ CST
Thu Jan  3 03:00:00 CET 2013
So you can use the short timezone name, but not the long version.

Or, for day calculations:
koos@greenblatt:~$ date --date="396 days"
Fri Feb 28 15:36:15 CET 2014

Tags: , ,

, reachable as PGP encrypted e-mail preferred.

PGP key 2C66 3B5D F0D7 C263 local copy PGP key 2C66 3B5D F0D7 C263 via keyservers pgp key statistics for 0x2C663B5DF0D7C263 Koos van den Hout
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews, Weather maps
This page generated in 0.008953 seconds.