Re: do shell script date with last month's date
Re: do shell script date with last month's date
- Subject: Re: do shell script date with last month's date
- From: Bryan Harris <email@hidden>
- Date: Fri, 14 Feb 2014 22:30:58 +0000 (GMT)
On Feb 14, 2014, at 08:44 AM, Christopher Stone <email@hidden> wrote:
On Feb 14, 2014, at 08:28, BevInTX <
email@hidden> wrote:
I think that would always give January, when I think you really want the previous month, whatever that would be for the current date?
"date -v-1m '+%B %Y'"
Whups. Good catch. Those minuses are tricky... :)
I know this question is already solved, here is just another way using the GNU version of date. It lets someone use more of a human language way of specifying the date. E.g. "-10 minutes", "+2 days" etc.
/usr/local/Cellar/coreutils/8.21/bin/gdate -d 'last month' +"%B %Y"
January 2014
It comes with coreutils, which you can get with one of the package installers like HomeBrew.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden