[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date -d yesterday?



On Fri, 8 Feb 2002, Christian Weisgerber wrote:

> Gregory Steuck <greg@nest.cx> wrote:
>
> > date -r $(expr $(date +%s) - 86400)
>
> This is problematic at daylight saving time switchover.

Since the original post only mentioned the date (and not a full
timestamp), this shouldn't be a problem. I've got a script that uses:
TIMESTAMP=`date -r $(expr $(date +%s) - 86400) +%Y%m%d`
All I want is the date, and that format sorts nicely.
+------------------------------------------------------------------------+
| Dave Taira <bodhi@hagakure.org>                2002.02.08/14:07:01 PST |
| Morlock for Hire                                                       |
+------------------------------------------------------------------------+
| "When the going gets weird, the weird turn pro."  --Hunter S. Thompson |
+------------------------------------------------------------------------+