[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: bash date math
- From: Goncalo <goncalo mail eunet pt>
- To: redhat-list redhat com
- Subject: Re: bash date math
- Date: Thu Jul 31 10:55:28 2003
> > In a bash script, I need to know the previous day.
> >
> > if 03012003 then 02282003
> > if 05012003 then 04302003
> > if 08012003 then 07312003
> >
> > using date, I can get todays date. But I need date math.
>
> $ date -d "-1 day"
> Wed Jul 30 10:48:46 EDT 2003
>
or
$ date -d yesterday
or
$ date -d "1 day ago"
Gonçalo
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]