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: find yesterday date using date command



Wow, thank you everyone for the responses.
The below command will give yesterday date. I tried to truncate the result down to the date only with:
do shell script "date +%a $(date -r $(( $(date +%s) - 86400 )))"
Doesn't seem to work. Am I missing something or is that even possible with 3 variables inside "date" command?

Again thank you very much for all the responses,

On Jan 1, 2007, at 4:12 PM, Mark J. Reed wrote:

The OP did ask for how to do this with the "date command"; assuming
that the shell command date(1) was actually intended, the result may
be achieved thus:

do shell script "date -r $(( $(date +%s) - 86400 ))"

Although if you have the GNU coreutils package installed (e.g. in
/sw/bin/ via fink, or in /opt/local/bin via MacPorts), it's a little
easier:

do shell script "/sw/bin/date -d yesterday"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/phanh% 40canby.k12.or.us
Archives: http://lists.apple.com/mailman//archives/applescript-users


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >find yesterday date using date command (From: Hung Phan <email@hidden>)
 >Re: find yesterday date using date command (From: "Mark J. Reed" <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.