Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

offset calendar days



[ I apologize for this not being a strictly zsh question, but I've
exhausted my other resources, and as a last resort am tapping the
expertise of this list. ]

I'd like to retrieve a calendar date offset in the future (or past). I
vaguely remembered one could do this by fiddling with the TZ
environment variable, but I don't know how to interpret the [+-]N
argument. For instance,

$ TZ=MST7MDT date
Fri Sep 29 14:50:17 MDT 1995
$ TZ=MST7MDT-1 date
Fri Sep 29 21:50:22 MDT 1995	# why didn't I get 15:50 here?

OK, maybe it isn't hours:

$ TZ=MST7MDT-24 date
Sat Sep 30 20:51:13 MDT 1995
$ TZ=MST7MDT-48 date
Sun Oct  1 20:51:16 MDT 1995
$ TZ=MST7MDT-72 date
Mon Oct  2 20:51:22 MDT 1995	# but this seems to indicate it is

$ TZ=MST7MDT-18	date		# using 18 gives me tomorrow at this time
Sat Sep 30 14:50:41 MDT 1995
$ TZ=MST7MDT-36 date
Sun Oct  1 08:50:55 MDT 1995

Anyone have any ideas or pointers? (I've checked our man pages for
date, time, timezone, stime, ctime, looked in
/usr/share/lib/zoneinfo/, and came up empty).

Thanks,

  -mb-




Messages sorted by: Reverse Date, Date, Thread, Author