5860 offset Indicates the value added to the local time to arrive at
5861 Coordinated Universal Time. The offset has the form:
5862 hh[:mm[:ss]]
5863 The minutes (mm) and seconds (ss) are optional. The hour (hh)
5864 shall be required and may be a single digit. The offset following
5865 std shall be required. If no offset follows dst, the alternative time
5866 is assumed to be one hour ahead of standard time. One or more
5867 digits may be used; the value is always interpreted as a decimal
5868 number. The hour shall be between zero and 24, and the minutes
5869 (and seconds)—if present—between zero and 59. The result of
5870 using values outside of this range is unspecified. If preceded by
5871 a '-', the timezone shall be east of the Prime Meridian;
5872 otherwise, it shall be west (which may be indicated by an
5873 optional preceding '+').
FreeBSD下可以用 -v 选项,Solaris 和 Linux似乎都不支持
mymtom@:src/shell$ date ; date -v-1d
Fri Aug 3 17:17:30 CST 2007
Thu Aug 2 17:17:30 CST 2007
====
-v Adjust (i.e., take the current date and display the result of the
adjustment; not actually set the date) the second, minute, hour,
month day, week day, month or year according to val. If val is
preceded with a plus or minus sign, the date is adjusted forwards
or backwards according to the remaining string, otherwise the
relevant part of the date is set. The date can be adjusted as
many times as required using these flags. Flags are processed in
the order given.