leopard date bug?
leopard date bug?
- Subject: leopard date bug?
- From: Donald Hall <email@hidden>
- Date: Sun, 25 Nov 2007 23:31:23 -0700
Can anyone explain this? Looks like a serious bug to me (note
differing results for 18, 20, and 100 years in the future):
Test script
---------------------------------------------------------------------------
set __today to (current date)
set newDate to __today + 10 * 365.25 * days
log newDate
set newDate to __today + 12 * 365.25 * days
log newDate
set newDate to __today + 14 * 365.25 * days
log newDate
set newDate to __today + 16 * 365.25 * days
log newDate
set newDate to __today + 17 * 365.25 * days
log newDate
set newDate to __today + 18 * 365.25 * days
log newDate
set newDate to __today + 20 * 365.25 * days
log newDate
set newDate to __today + 100 * 365.25 * days
log newDate
-------------------------------------------------
End of test script
Leopard (10.5.0) result:
--------------------------------------------------
tell current application
current date
date "Sunday, November 25, 2007 11:17:29 PM"
(*Saturday, November 25, 2017 11:17:29 AM*)
(*Monday, November 25, 2019 11:17:29 PM*)
(*Thursday, November 25, 2021 11:17:29 AM*)
(*Saturday, November 25, 2023 11:17:29 PM*)
(*Monday, November 25, 2024 5:17:29 AM*)
(*Friday, September 18, 2009 12:46:20 AM*)
(*Friday, September 18, 2009 12:44:54 AM*)
(*Friday, September 18, 2009 12:43:28 AM*)
end tell
Tiger result:
---------------------------------------------------
tell current application
current date
date "Sunday, November 25, 2007 11:24:21 PM"
(*Saturday, November 25, 2017 11:24:21 AM*)
(*Monday, November 25, 2019 11:24:21 PM*)
(*Thursday, November 25, 2021 11:24:21 AM*)
(*Saturday, November 25, 2023 11:24:21 PM*)
(*Monday, November 25, 2024 5:24:21 AM*)
(*Tuesday, November 25, 2025 11:24:21 AM*)
(*Thursday, November 25, 2027 11:24:21 PM*)
(*Saturday, November 26, 2107 11:24:21 PM*)
end tell
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden