I'm trying to find a means, given a week number, to find the
date of
the Monday and Friday. I was wondering if I could use GNU
date to do
that straightforwardly instead of having to program this.
One first problem is how to get the n-th week of the year.
The
following seems to work:
% LC_ALL=C date -d '2007-01-01 7 weeks'
Mon Feb 19 00:00:00 CET 2007
but actually, it does not necessarily point to a Monday:
% LC_ALL=C date -d '2006-01-01 7 weeks'
Sun Feb 19 00:00:00 CET 2006
Then, the second issue, is how to use something like
"next Friday", or
"last Monday" relatively to a date.
% LC_ALL=C date -d '2006-01-01 next friday'
Sun Jan 1 00:00:00 CET 2006
(silently ignoring the "next Friday" part).
% LC_ALL=C date -d 'next friday after 2006-01-01'
date: invalid date `next friday after 2006-01-01'
Thanks in advance!
_______________________________________________
help-gnu-utils mailing list
help-gnu-utils gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-utils
|