Skip to content

Instantly share code, notes, and snippets.

@sh78
Created April 18, 2018 02:16
Show Gist options
  • Save sh78/5c0864a0d4438cc31d2a3ce6a7228fed to your computer and use it in GitHub Desktop.
Save sh78/5c0864a0d4438cc31d2a3ce6a7228fed to your computer and use it in GitHub Desktop.
set theDate to current date
=> date object
set theDate to current date as string
=> Thursday, December 03, 2015 at 09:57:25
set theDate to current date
set y to rich text -4 thru -1 of ("0000" & (year of theDate))
set m to rich text -2 thru -1 of ("00" & ((month of theDate) as integer))
set t to rich text -2 thru -1 of ("00" & (day of theDate))
set theNiceDate to y & "-" & m & "-" & d
# theNiceDate === "2015-12-03"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment