• 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: Wrong day name in Date format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong day name in Date format


  • Subject: Re: Wrong day name in Date format
  • From: Christopher Nebel <email@hidden>
  • Date: Tue, 27 Oct 2009 16:54:14 -0700

On Oct 25, 2009, at 12:41 PM, Doug McNutt wrote:

At 10:38 -0700 10/25/09, Michelle Steiner wrote:
If you enter a wrong day name in a date with Snow Leopard, Applescript automatically corrects it upon compilation. For example, if you enter
date "Monday, October 25 2009 14:00:00"


It compiles to
date "Sunday, October 25, 2009 12:00:00 AM"

In previous versions, it would throw an error at compilation.
-- Michelle


1) One reason for including a day name is for data validation. How can AppleScript be sure that it was the name and not the numerical data was the error?


2) Is the change from 14:00:00 to 12:00:00 AM reasonable to anyone? 12:00:00 AM is ambiguous and 1400 is pretty clearly 2 PM. It looks, at least here, as though EST and MST were confused they way they often are in bank statements.

It's not really confusing one time for another, it's failing to accept "14:00:00" as valid (probably because the date preferences specify 12- hour time, in which case the new rules require that you use 12-hour time), but the final date must have some time attached to it, so it picks midnight. This is less than ideal.


3) Why doesn't AppleScript add the current time zone setting while it's at it? Those -0700 items in email times are helpful.

It will if you put the time zone as part of your "long" date format.

4) Does the change apply to data read from, say, an email header as well as when dates are added in code? Why would a date be hard coded anyway? Are dates in comment fields changed?

It applies to any string-to-date coercion or specifier, such as "x as date" or "date x", which also happens automagically to literal date specifiers in scripts. Comments are uninterpreted text, and are therefore immune.



--Chris Nebel AppleScript Engineering _______________________________________________ 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: Wrong day name in Date format
      • From: Michelle Steiner <email@hidden>
References: 
 >Wrong day name in Date format (From: Michelle Steiner <email@hidden>)
 >Re: Wrong day name in Date format (From: Doug McNutt <email@hidden>)

  • Prev by Date: Re: How do I avoid a Repeat loop to abort upon errors?
  • Next by Date: Re: Wrong day name in Date format
  • Previous by thread: Re: Wrong day name in Date format
  • Next by thread: Re: Wrong day name in Date format
  • Index(es):
    • Date
    • Thread