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

Re: Date weirdness


  • Subject: Re: Date weirdness
  • From: Matt Deatherage <email@hidden>
  • Date: Wed, 1 Aug 2007 04:23:36 -0500

On 8/1/07 at 1:39 AM, Marc Myers <email@hidden> wrote:

> Why is the third date different from the first two?  Everything I've
> read about AppleScript dates says that any date items you don't supply
> will be supplied from the current date/time.
>
> I'm running AppleScript 1.9.3 under Mac OS X 1.3.9.

Unless you mean "Mac OS X 10.3.9," that's a neat trick.

It's the same under 10.4.10, though - if you supply any time after the
partial date "8/1", AppleScript's date parser (perhaps the system's, not
sure) is assuming that the very next number is the year.

--> date "8/1 3:15 AM"
<-- date "Friday, August 1, 2003 3:00:00 AM"

--> date "8/1 0300"
<-- date "Wednesday, August 1, 2300 12:00:00 AM"

--> date "08/01 03:00:00 AM"
<-- date "Friday, August 1, 2003 12:00:00 AM"

--> date "8/1 1500"
<-- date "Wednesday, August 1, 1500 12:00:00 AM"

--> date "8 1 3 15"
<-- date "Friday, August 1, 2003 3:00:00 PM"

--> date "8 1 3 19 24"
<-- date "Friday, August 1, 2003 7:24:00 PM"

--> date "8 1 3 19 24 56"
<-- date "Friday, August 1, 2003 7:24:56 PM"

I can't tell you *why*, but that's what it's doing.  Obviously it's not
taking the space as a different delimiter than the one separating the
month and day, so it sees everything as "month day year hour minute"
unless it can parse six numbers out of it.

--
Matt Deatherage                              <email@hidden>
GCSF, Incorporated                      <http://www.macjournals.com>

"Oysters are supposed to enhance your sexual performance, but they don't
 work for me.  Maybe I put them on too soon."  -- Garry Shandling


 _______________________________________________
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

  • Prev by Date: mail content of corrent tab from Safari 3...
  • Next by Date: [test]
  • Previous by thread: mail content of corrent tab from Safari 3...
  • Next by thread: [test]
  • Index(es):
    • Date
    • Thread