Created
February 23, 2016 14:08
-
-
Save shibaku/75fb8f428954a7b35bae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set thisYear to do shell script "date '+%Y'" | |
set thisMonth to do shell script "date '+%m'" | |
set lastMonth to do shell script "date -v -1m '+%m'" | |
set thisDay to do shell script "date '+%d'" | |
(If I'm processing reports at the end of the month, use current month for file name. If not, use last month. *) | |
if thisDay > 20 then | |
set myDate to thisYear & "-" & thisMonth | |
else | |
set myDate to thisYear & "-" & lastMonth | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment