On Apr 21, 2015, at 09:24, Jean-Christophe Helary <email@hidden> wrote:I found that the Applescript Language Reference does not seem to represent the date function properly ______________________________________________________________________
Hey Jean-Christophe,
ASLG:
Special Considerations You can create a date object using a string that follows the date format specified in the Formats pane in International preferences.
* Now in Language & Region (advanced)
--
The date format is affected by your system date format.
The date object is not quite as forgiving as it used to be in figuring out what is meant by a specific date string.
On my system (10.9.5):
# date "05/04/1961 11:30" compiles to: date "Thursday, May 04, 1961 at 11:30:00 GMT-5"
If you want your date to be displayed just so then you have to create it yourself from the date object's parts:
set {year:y, month:m, day:d, hours:hrs, minutes:min, seconds:sec} to current date
set dStr to "05/04/1961 at 11:30" set d to date dStr set seconds of d to 10
tell d set {y, m, mStr, d, tStr} to {year, its month as number, its month as text, day, time string} end tell
--> {1961, 5, "May", 4, "11:30:10 GMT-5"}
You'll find a lot of discussion about dates on the list by searching with Google:
But ask if you have specific needs.
-- Best Regards, Chris
|