Date Format Change

Hi,

Please can I have some command to get yesterday in YYMMDD format?
This will be used in ksh
Thanks,

Refer http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html

Kindly use google search on this site...

I found a new way to show yesterday. Share to everyone.

awk 'BEGIN{ yesterday=strftime( "%y%m%d", systime()-24*60*60 ); print yesterday}'

with function strftime(), you can customize the time.

for example, if you need show 2 hours ago:

awk 'BEGIN{ t=strftime( "%y%m%d %H%M", systime()-2*60*60 ); print t}'