On Sun, Mar 17, 2013 at 10:00 AM, Carl Fitch <[email protected]> wrote: > Very interesting! On my MAcBook there is not a --date parameter and -d is: > >> -d dst Set the kernel's value for daylight saving time. If dst is >> non-zero, future calls to gettimeofday(2) >> will return a non-zero for tz_dsttime. > > > My experience with --date was as a way to convert formats in bash scripts: > >> date +%F --date=05/12/1953 >> 1953-05-12
Exactly. One use of the date command is to display various date/time formats. By default, date uses the current system time and timezone. But the --date= option enables date to use an alternate date/time specified by STRING. What range of possible strings are valid is not immediately obvious. It's as though the STRING section of the manual was omitted. Some examples: # default, today, now -- all equivalent date date --date=now date --date=today # unix epoch date --date=@0 date --date=@0 -u # past, future date --date=yesterday date --date=tomorrow date --date="next week" date --date="last week" # future day of week, Sunday-Saturday, abbreviations work. Midnight local timezone. date --date=sat date --date=sat -u # 1-2 digit number == today's hour (0-23), local timezone, unless specified date --date=10 date --date=10 -R date --date=10 -R -u # 3-4 digit numbers == today's time date --date=010 date --date=1010 # 5-?? digit numbers == a date; 6-digit dates are assumed to be 1900 or 2000 years date --date=71010 -u date --date=871010 -u date --date=0871010 -u date --date=9871010 -u date --date=19871010 -u What surprises me is that I have not found any of this information described in the man pages. Instead, it is documented in the info pages, but again somewhat cryptically and with few examples. Regards, - Robert -- -- Central West End Linux Users Group (via Google Groups) Main page: http://www.cwelug.org To post: [email protected] To subscribe: [email protected] To unsubscribe: [email protected] More options: http://groups.google.com/group/cwelug --- You received this message because you are subscribed to the Google Groups "Central West End Linux Users Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
