Re: date/Snow Leopard changed
Re: date/Snow Leopard changed
- Subject: Re: date/Snow Leopard changed
- From: Christopher Nebel <email@hidden>
- Date: Sat, 5 Sep 2009 21:26:09 -0700
On Sep 5, 2009, at 2:38 PM, Deivy Marck Petrescu wrote:
Long time ago there was a software that was really user friendly and
allowed people to write nifty applications. It is here no more.
It programming language was called HyperTalk, a sister of AppleScript.
The program was HyperCard.
It had, in the early 90s a way to deal with dates that would allow
everyone, no matter where they were and how they wrote their dates
it would be converted properly to the users Mac.
It was called dateItems. And it was "year,month,day, hour,
minutes, seconds"
So given a dateItem we could convert it to any time format.
Isn't is time AS would have something like that?
Maybe I'm missing something here, but that sounds like the existing
date object. It's a class, and it's got read/write properties for all
those parts, and they're all documented. People run into problems
because they try to deal with dates by assembling strings and
converting them, which is obviously prone to format issues. Fine:
don't use the formatted string, use the properties, like Shane
described earlier in the thread.
The problem of taking arbitrary input and teasing a date out of it is
a separate problem. If there are cases the new API doesn't handle,
please file bugs; the actual component is ICU, but you can file them
against AppleScript and we'll route them to the right place. It's
actually more flexible than the release notes say (they were accurate
at the time). I need to confirm this with the ICU people, but it
looks like it requires that the components all be present in the right
order, but the punctuation and white space between them doesn't
matter. For example, on my US system, "9/4/2009", "9-4-2009", and "9
4 2009" all evaluate to September 4, 2009.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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