I am designing an AppleScript which contains a hard-coded date to which the script refers multiple times throughout the duration of the execution. An example is as follows:
property someDate : date "Monday, 1 January 2018 at 01:00:00 PM"
As one can see, the format of the timestamp is appropriate for my region and country. Another example would be:
Saturday, April 15, 2006 4:29:04 PM or
12/25/04 - which is the format for other regions such as the US -
The following questions arise
- If my AppleScript will be run in other regions/countries
(those with different timestamp formats eg.
mm/dd/yyinstead of my
dd/mm/yy), how does AppleScript behave with the above declaration?
- How should I ensure that AppleScript will correctly convert the timestamp from my format into the respective format used by the end user's device?
The proper conversion becomes critical if the format of the date changes to the previously mentioned
dd/mm/yy and is then used in a
mm/dd/yy environment (region or country). In that case, the order may not be apparent.
property someDate : date "02/01/18" as
dd/mm/yy would be hard-coded with the intention of representing 02 January 2018, but when used in a different region (those using
mm/dd/yy); naturally, this will become 01 February 2018. See the issue?
As my research into this leads nowhere fast (and should be specific to AppleScript), I hope somebody who has implemented similar code could assist me in clarifying the two points above. Thank you.