• 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 syntax not working on 10.10.5?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date syntax not working on 10.10.5?


  • Subject: Re: date syntax not working on 10.10.5?
  • From: "Stockly, Ed" <email@hidden>
  • Date: Thu, 20 Aug 2015 17:12:52 +0000
  • Thread-topic: date syntax not working on 10.10.5?

Your answer match my assumptions.
You assume that :
Date "9/4"
Date "9/4/15"
Date "09/04/2015"
Date "9/4/2015"
are OK

But I disagree.

Right, but those aren't my assumptions. I was going back to Mac OS9 when it didn't matter where you were or what your settings were, but would return the same result, which I understand didn't work for you or anyone not following the US standard (make that common practice).

But the point is that it worked consistently for any script anywhere, and you would understand that as you wrote your scripts and account for it, as would I if we had a universal date string that could be coerced.

On some machines they will create : date "Friday, September 4, 2015 at 12:00:00 AM"
but on others like mine when I use the standard format used in France, it returns : 
date "Friday, September 4, 2015 at 12:00:00 AM"

I don't see a difference. But later versions, when this first started breaking, could have returned March 9, rather than Sept. 4.

If that's what you mean, I get that.


At this time, for see, the default format is set the ISO 8601 one so your first one : "9/4" issue an error.
With this setting,  date "2015-09-04 10:15" funnily enough compiles flawlessly as date "vendredi 4 septembre 2015 10:15:00"

Right, that will correctly compile on some machines, but not on others, depending on your settings. 

What I'm saying is that there should be a universal date format in the system that we can count on to accurately and consistently compile to or result in the correct date on any mac in any region, regardless of the local settings. That format would work just fine for me and you both.


The only way to always get a valid date is to ask the system to build the short date string by itself and complete it with the time components.'

Agreed, and that is exactly my complaint, that there's no consistent way to do this without doing that. Now I can easily do that in my scripts, but it's when pulling dates from outside sources in text that I have issues. AppleScript once did that flawlessly (for me, I know) and now I have to rely on user interface. 


Try to run the script below and check if what you get is what I get with my standard default format.
I'm sure that you will not.

I get a inconsistent and often inaccurate mess. I wonder if you get a different, inconsistent and inaccurate mess. (I added the maybe variable to the non-rejected string to make it easy to compare in the log)


 (*01, 10:20:12, is rejected*)
(*02, 10:20 12, is rejected*)
(*03, 10:20 12, is rejected*)
(*04, 10:20-12, is rejected*)
(*05, 10:20:12 AM - Thursday, August 20, 2015 at 10:20:12 AM*)
(*06, 22:20:12 AM - Thursday, August 20, 2015 at 10:20:12 PM*)
(*07, 10:20-12 PM - Thursday, August 20, 2015 at 10:20:12 PM*)
(*08, 22:20-12 PM - Thursday, August 20, 2015 at 10:20:12 AM*)
(*09, 10:20;12, is rejected*)
(*10, 10:20,12, is rejected*)
(*11, 10:20a12, is rejected*)
(*12, 10:20/12, is rejected*)
(*13, 10:20?12, is rejected*)
(*14, 10:20@12, is rejected*)
(*15, 10@20:12, is rejected*)
(*16, 10:20, is rejected*)
(*18, 10-20, is rejected*)
(*19, 10a20, is rejected*)
(*20, 01/12/2015 - Monday, January 12, 2015 at 12:00:00 AM*)
(*21, 31-12-1943, is rejected*)
(*22, 12/31/1943 - Friday, December 31, 1943 at 12:00:00 AM*)
current date
(*101, 8/20/15 10:20:12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*102, 8/20/15 10:20 12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*103, 8/20/15 10:20 12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*104, 8/20/15 10:20-12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*105, 8/20/15 10:20:12 AM - Thursday, August 20, 2015 at 10:20:12 AM*)
(*106, 8/20/15 22:20:12 AM - Thursday, August 20, 2015 at 10:20:12 PM*)
(*107, 8/20/15 10:20-12 PM - Thursday, August 20, 2015 at 10:20:12 PM*)
(*108, 8/20/15 22:20-12 PM - Friday, August 21, 2015 at 10:20:12 AM*)
(*109, 8/20/15 10:20;12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*110, 8/20/15 10:20,12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*111, 8/20/15 10:20a12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*112, 8/20/15 10:20/12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*113, 8/20/15 10:20?12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*114, 8/20/15 10:20@12 - Thursday, August 20, 2015 at 12:00:00 AM*)
(*115, 8/20/15 10@20:12 - Thursday, August 20, 2015 at 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

  • Follow-Ups:
    • Re: date syntax not working on 10.10.5?
      • From: Michael Grant <email@hidden>
    • Re: date syntax not working on 10.10.5?
      • From: Yvan KOENIG <email@hidden>
References: 
 >date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Christopher Stone <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Shane Stanley <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: "Stockly, Ed" <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Yvan KOENIG <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Shane Stanley <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Shane Stanley <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: "Stockly, Ed" <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Shane Stanley <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: "Stockly, Ed" <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Shane Stanley <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: "Stockly, Ed" <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: date syntax not working on 10.10.5?
  • Next by Date: Re: date syntax not working on 10.10.5?
  • Previous by thread: Re: date syntax not working on 10.10.5?
  • Next by thread: Re: date syntax not working on 10.10.5?
  • Index(es):
    • Date
    • Thread