• 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/time weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date/time weirdness


  • Subject: Re: Date/time weirdness
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 29 Jul 2004 08:36:04 -0700

On 7/29/04 7:42 AM, "Michelle Steiner" <email@hidden> wrote:

> Exactly what is going on here?
>
> set foo to "16/15/14"
> date foo
>
> --> date "Thursday, July 29, 2004 4:15:14 PM"
>
> The minutes and seconds correspond to the last two integers expressed
> in the string. The hours vary with the first integer, but I can't
> figure out the exact relationship. The date is the current date.

4 PM is 16:00 hours.

Because you've presented something that AppleScript knows can't be a date
in your format (mm/dd/yy) since there's no month 16, it assumes the current
date and interprets your figures as a time. Since again the format doesn't
fit into your 12-hour clock AM/PM format but 16 hours does make sense in
24-hour clock time, it interprets it that way rather than throwing "Invalid
date and time" which it will do if the first figure > 24, or the second or
third is greater than > 59 (when the first > 12 so must be a time, not a
month). It accepts all sort of things as separators for dates and times.

--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Date/time weirdness (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: Re: Date/time weirdness
  • Previous by thread: Date/time weirdness
  • Next by thread: Re: Date/time weirdness
  • Index(es):
    • Date
    • Thread