Is there an in-built function that returns the date in the format of “dd/MM/yyyy”? I can see just about every other variation and most assume 2-digit year, which is a bit 1990s
the closest I could find was:
formattedTime(the timeFormat's shortdate, now)
alternatively if there is a setting like
set clockformat to "24"
that will force the year interpretation to 4-digit year?
If you want to use this for any date, here is the format:
set myDate to today
log formattedTime("%m",myDate) &"/"& formattedTime("%d",myDate) &"/"& formattedTime("%Y",myDate)
If you want to use it for the current date, you can simplify it to this: log formattedTime("%m",Date) &"/"& formattedTime("%d",Date) &"/"& formattedTime("%Y",Date)
Speaking of outdated formats like 2-digit years, the formatting codes using “%” are very old-school now! Take a look at the documentation on date and time formats and use the bracket formats instead: put formattedTime("[day]/[month]/[year]", tomorrow)
or, for 2-digit day and month: put formattedTime("[da]/[mo]/[year]", tomorrow)
And (this may not be well documented – I’ll try to correct that soon) you can also do it this way: put tomorrow with format "[day]/[month]/[year]"