• 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: NSDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDate


  • Subject: Re: NSDate
  • From: Philip Aker <email@hidden>
  • Date: Tue, 31 Aug 2010 15:01:25 -0700

On 2010-08-31, at 04:30:47, Shane Stanley wrote:

> On 31/8/10 7:25 PM, "Philip Aker" <email@hidden> wrote:
>
>> I customize my date format in System Preferences to look like ISO. There are
>> problems in AppleScript if I don't use that format to concoct a date. i.e. I'm
>> pretty much limited to:
>>
>> set dstr to "2010-08-31"
>> date dstr
>>
>> But that doesn't bug me because there's a lot of benefit to using an
>> international standard for a date format.
>
> But that's not the ASObjC problem. Take this:
>
> set x to date string of (current date)
> set y to date x
> y as text
>
> It works fine in AS, but in ASObjC you get:
>
> Can’t make «script» into type text.
>
> The expression "date <some string>" just isn't returning a date.

I see it might be a different issue. But with POSIX and ISO-like system preferences on my setup I typically get this type of error:

set dstr to "1/1/2010"
date dstr

--> Invalid date and time date 1/1/2010 of «script»

and didn't get the granularity. I thought it was because of the coordination of CFDate/NSDate -> AppleScript date (which was a real problem for me with 10/4/10.5 software because of the conversion functions disappearing in 64-bit). But maybe I dislike localized dates so much I wanted to turn the problem into something I could hit with my hammer.


> Similarly with POSIX path:

>   set x to POSIX file "/"
>   x as text

> Results in:

>  Can’t make «script» into type text.


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: NSDate (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: NSDate
  • Previous by thread: Re: NSDate
  • Index(es):
    • Date
    • Thread