• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: date/Snow Leopard changed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date/Snow Leopard changed


  • Subject: Re: date/Snow Leopard changed
  • From: Deivy Marck Petrescu <email@hidden>
  • Date: Sun, 6 Sep 2009 20:08:55 -0400


On Sep 6, 2009, at 00:26, Christopher Nebel wrote:

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



Chris,
I am missing something... the dateItems à la HyperCard.

As you say at the end of your letter
"For example, on my US system, "9/4/2009", "9-4-2009", and "9 4 2009" all evaluate to September 4, 2009."


"on my US system" being the key.

AS is international and Apple sells computer all over the world. I am impressed as the effort put forward by Apple to accommodate everyone.
But when it comes to date in AS, I still have to guess as to what is the locale we are working with.
Which by the way generated a flood of emails because everyone uses his/ hers date.
So if I set


property dt: date "05/06/07"

How is that going to be interpreted in Yvan's computer? What about Axel's?
How about mine, that uses the American date but uses the 24 hour clock?


In Hypertalk we could (I forgot Hypertalk, so don't take me literally)

property dt: dateItems "2009,09,06,1,19,48,24"

And in every computer running Hypertalk it would get the correct date (today's date in this example)
Note also that if I had this to be run by an user, I can force the user to give me any date as date item


set item_1_of_date_Item to text returned of display dialog "enter year ....

We should not have this kinds of long threads because we can not agree on time.
I said that Bob Poland's computer had a problem... I had a problem I forgot am/pm since I don't use it.
So, I am all for a dateitems that is locale independent. A timeItems iwould be better but we can use date string since it always return am/pm.
But the whole idea is to have a locale independent way of sharing dates.


By the way I'd prefer a dateItems without weekday.

It does not hurt to ask... :)



Deivy Petrescu
email@hidden





_______________________________________________
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
  • Follow-Ups:
    • Re: date/Snow Leopard changed
      • From: Yvan KOENIG <email@hidden>
    • Re: date/Snow Leopard changed
      • From: email@hidden
References: 
 >Re: date/Snow Leopard changed (From: Doug Tallman <email@hidden>)
 >Re: date/Snow Leopard changed (From: Yvan KOENIG <email@hidden>)
 >Re: date/Snow Leopard changed (From: LuKreme <email@hidden>)
 >Re: date/Snow Leopard changed (From: Deivy Marck Petrescu <email@hidden>)
 >Re: date/Snow Leopard changed (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Safari, make new document only if none open ?
  • Next by Date: Re: Accessing front window of Mail.app
  • Previous by thread: Re: date/Snow Leopard changed
  • Next by thread: Re: date/Snow Leopard changed
  • Index(es):
    • Date
    • Thread