Localized Date format

Anyone know how to get the user’s date format?

Joe

This is based on code passed along by jj & Fredo:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Any way to find the seperator as well? And does this work for like the Chinese language?

Joe

I’ve modified the code to get the customized separator as well but this requires Mac OS 10.3+ since it uses the new property of the date “short date string”. I’ve tested this by changing the region setting in the “Formats” tab of the International preference pane. It seems to work fine for Chinese (and other non-Roman script based languages) since the numbers remain in Roman script:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Hm, thanks! Would the unix date command return the correctly formatted text to remove Panther dependencies?

From the date man page:

   %x     locale's date representation (mm/dd/yy)

Joe