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

2013-01-02 1 year 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: , ,

IPv6 readyIPv6 ready
, reachable as koos+website@koos.idefix.net. PGP key DSS/1024 0xF0D7C263 RSS
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews, Weather maps
This page generated in 0.063248 seconds.