Sunday, May 08, 2011

Formatting output from `date' [Shell]

Formatting output from `date'


date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S"


Output:

DATE: 2011-05-08
TIME: 09:52:21


Also

echo `date "+%Y-%-m-%-d" -d2012-02-01`
2012-2-1