On May 24, 2010, at 3:39 PM, Mark J. Reed wrote: To make the date object safe for such field-at-a-time modification, you must first either set the month to one that works with any legal day number, or set the day number to one that works with any month. To meet these criteria you can set the month to any 31-day month (January, March, May, July, August, October, or December), or set the day to any number between 1 and 28 inclusive.
So, it would seems that this handler is safe ...
on getAsDate(theYear, theMonth, theDay) set theDate to (current date) set day of theDate to 1 set month of theDate to theMonth set day of theDate to theDay return theDate end getAsDate
If you need it, add hours, minutes, seconds.
|