Re: Changing current date format
Re: Changing current date format
- Subject: Re: Changing current date format
- From: Deivy Petrescu <email@hidden>
- Date: Mon, 20 Jan 2014 18:25:31 -0500
On Jan 20, 2014, at 17:14 , Shane Stanley <email@hidden> wrote:
> On 21 Jan 2014, at 7:42 am, Christopher Stone <email@hidden> wrote:
>
>> So rather than hardcode the localization string, it would appear that you could feed it to the hander as part of the call - and it would do the right thing. Yes?
>
> Sure. You could do something like:
>
> on formatDate:theDate usingFormat:formatString andLocale:localeID
> if class of theDate is date then set theDate to my makeNSDateFrom:theDate
> set theFormatter to current application's NSDateFormatter's new()
> if localeID is not missing value then
> theFormatter's setLocale:(current application's NSLocale's localeWithLocaleIdentifier:localeID) -- set locale
> end if
> theFormatter's setDateFormat:formatString
> set theString to theFormatter's stringFromDate:theDate
> return theString as text
> end formatDate:usingFormat:andLocale:
>
> Then change the original to:
>
> on formatDate:theDate usingFormat:formatString
> return my formatDate:theDate usingFormat:formatString andLocale:(missing value)
> end formatDate:usingFormat:
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>
I am getting very upset with you Shane!
You are making it very compelling for us all to go into ASOC.
What is your goal???
Progress???
Give us a brake.
;-)
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