You can specify a date different from the current date using the -d option. The argument will be a date string in a standard format with or without an additional amount of time, relative to the specified date. For example, the following are all valid date specifications:
Code:
date -d yesterday
date -d 20080711
date -d "20080711 4 days"
date -d "2 days ago"
date -d "20080711 2 days ago"
date -d "1 month ago"
date -d tomorrow
and so on... Look at
info date (sections "Options for date" and "Date input formats") for more details.