Leopard Date Bugs
Leopard Date Bugs
- Subject: Leopard Date Bugs
- From: Loren Ryter <email@hidden>
- Date: Fri, 16 Nov 2007 13:06:36 -0500
- Thread-topic: Leopard Date Bugs
Title: Leopard Date Bugs
I frequently create date objects to do time/date calculations. Apparently this is horribly buggy on Leopard.
See the following test results.
Bottom line in this case: date objects for year 1000 calculated wrong by Leopard on any region/calendar. Date strings calculated wrong on Leopard when region and calendar are Japanese, and generates error on Leopard when region is Japanese and calendar is Gregorian.
All calculations produce expected results on Tiger.
---------------------------
set y1k to "1/1/1000"
set y1k_d1 to date y1k
set y1k_ds to (date string of (y1k_d1))
set y1k_d2 to date y1k_ds
(*
LEOPARD RESULTS:
Gregorian calendar, any Region:
y1k_d1 = date "Wednesday, January 1, 1000 12:00:00 AM"
y1k_ds = Tuesday, December 26, 0999
Error:
Invalid date and time Tuesday, December 26, 0999.
TIGER RESULTS:
any region, and calendar format
y1k_d1: date "Wednesday, January 1, 1000 12:00:00 AM"
y1k_d2: date "Wednesday, January 1, 1000 12:00:00 AM"
y1k_ds: Wednesday, January 1, 1000
*)
set y2k to "1/1/2000"
set y2k_d1 to date y2k
set y2k_ds to (date string of (y2k_d1))
set y2k_d2 to date y2k_ds
(*
RESULTS:
LEOPARD International Pref Pane
language = english or Japanse
format/region = Japanese
Calendar = Japanese
y2k_d1 = date "Saturday, January 1, 2000 12:00:00 AM"
y2k_ds = 平成12年1月1日土曜日
y2k_d2 date "Saturday, December 1, 2001 12:00:00 AM"
LEOPARD International Pref Pane
language = english or Japanese
format/region = Japanese
Calendar = Gregorian
error at line:
set y2k_d2 to date y2k_ds
Invalid date and time 2000年1月1日土曜日.
TIGER International Pref Pane
language = english or Japanse
format/region = Japanese
Calendar = Japanese
y2k_d1 = date "Saturday, January 1, 2000 12:00:00 AM"
y2k_ds = Saturday, January 1, 2000
y2k_d2 =date "Saturday, January 1, 2000 12:00:00 AM"
TIGER International Pref Pane
language = english or Japanese
format/region = Japanese
Calendar = Gregorian
y2k_d1 = date "Saturday, January 1, 2000 12:00:00 AM"
y2k_ds = Saturday, January 1, 2000
y2k_d2 =date "Saturday, January 1, 2000 12:00:00 AM"
*)
_______________________________________________
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