[WBEL-users] date command

John Haxby jch at thehaxbys.co.uk
Mon Jul 4 07:02:04 CDT 2005


Andrew Vong wrote:

> I am currently using the following command -
>
> date "+%d/%m/%Y" to get me the date in the following format 04/07/2005.
>
> I am trying to set the %d (day) to 1 day before... so when I run --> 
> date "+%d/%m/%Y" <-- it should give me yesterday's date (i.e. 03/07/2005)

Wonderful things, man pages,

    date -d yesterday +%d/%m/%Y

or, probably,

    date -d yesterday +%x

jch


More information about the Whitebox-users mailing list