Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get yesterday's date on the terminal, mac os x



Louie Miranda wrote:
Tried this command to get the yeterday's date.

date -v -1d +"%Y%m%d"

But did not work..

date: illegal option -- v
usage: date [-nu] [-r seconds] [+format]
       date [[[[[cc]yy]mm]dd]hh]mm[.ss]

How can i get yesterday's date?

A bit convoluted:

    date -r  $((`date '+%s'` - 86400))

but seems to work. ;-)

HTH,
Axel
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden

References: 
 >Get yesterday's date on the terminal, mac os x (From: Louie Miranda <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.