• 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: The latest AS date and AS Editor bugs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The latest AS date and AS Editor bugs


  • Subject: Re: The latest AS date and AS Editor bugs
  • From: Shane Stanley <email@hidden>
  • Date: Thu, 23 May 2013 11:54:52 +1000

On 23/05/2013, at 10:14 AM, Nigel Garvey <email@hidden> wrote:

Interesting.

This might give you a clue as to what's going on (date stuff makes my head hurt). Open a Cocoa-AppleScript window in AppleScript Editor and run this:

set x to current application's NSDate's dateWithNaturalLanguageString_("31 December 1847 11:59:59 AM")
set y to current application's NSDate's dateWithNaturalLanguageString_("31 December 1846 11:59:59 AM")
-- make a date formatter
set df to current application's NSDateFormatter's alloc()'s init()
tell df to setDateStyle_(current application's NSDateFormatterFullStyle)
tell df to setTimeStyle_(current application's NSDateFormatterFullStyle)
-- set formatter's time zone to London, for the great unwashed
set tz to current application's NSTimeZone's timeZoneWithName_("Europe/London")
tell df to setTimeZone_(tz)
-- get date string
display dialog (df's stringFromDate_(x) as text) & ", " & return & df's stringFromDate_(y) as text

You should see something like:

Friday, 31 December 1847 1:59:59 AM GMT, 
Thursday, 31 December 1846 1:58:44 AM GMT-00:01:15

depending on your date formatting. Notice that the time zone changes, by your 75 seconds.

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >Re: The latest AS date and AS Editor bugs (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: Applescript in the future
  • Next by Date: Re: Applescript in the future
  • Previous by thread: Re: The latest AS date and AS Editor bugs
  • Next by thread: Re: The latest AS date and AS Editor bugs
  • Index(es):
    • Date
    • Thread