Yesterday I discovered a nice feature of ksh93: It has
support for date manipulation with printf (ksh's builtin).

See this post:
http://blog.fpmurphy.com/2008/11/korn-shell-93-secrets-1.html

Examples (from the page above):

$ printf "%T\n" "2:00pm yesterday"
Fri Mar 21 14:00:00 EST 2008

printf  "%(%a)T\n"  "final day Feb 2008"
Fri

$ printf  "%(%D)T\n" "3rd wednesday may 2008"
05/21/08

$ printf  "%(%D)T\n" "4 weeks ago"
02/18/08

It also understands crontab format:
$ printf "%T\n" "0 0 1,15 * 1"
Mon Sep 1 00:00:00 EDT 2008

According to Glenn Fowler[1] it's better to write the dates
like this:

$ printf "%(%K)T\n" "Sept 23 2009 noon"
2009-09-23+12:00:00

$ printf "%(%K)T\n" "Sept 23 2009 noon 90 days"
2009-12-22+12:00:00

$ printf "%(%K)T\n" "Sept 23 2009 noon 90 days hence"
2009-12-22+12:00:00

$ printf "%(%K)T\n" "Sept 23 2009 noon 90 days ago"
2009-06-25+12:00:00

That is, with the "reference date first" and the modifiers.

--

[1]
http://www.mail-archive.com/ast-users@research.att.com/msg00680.html