• 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: Rép: date/Snow Leopard changed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rép: date/Snow Leopard changed


  • Subject: Re: Rép: date/Snow Leopard changed
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 2 Sep 2009 21:58:19 -0400

On Wed, Sep 2, 2009 at 8:48 PM, Tim Mansour<email@hidden> wrote:
> (example on Leopard, I assume same for SL)
>
> set d to current date
> --> date "Sunday 28 February 2010 12:00:00 am"
> set day of d to 31
> --> date "Wednesday 3 March 2010 12:00:00 am"
> set month of d to 7
> --> date "Saturday 3 July 2010 12:00:00 am"

Logical, but perhaps surprising, yes.

On Leopard, at least, trying to set them both "in parallel" doesn't
help, either:

set {day of d, month of d} to {31, 7}
--> date "Saturday, July 3, 2010 12:00:00 AM"

...since it really does a serial assignment in left-to-right order.

> A workaround is:
>
> set d to current date
> --> date "Sunday 28 February 2010 12:00:00 am"
> set month of d to 1 -- because it has 31 days
> set day of d to 31
> set month of d to 7
> --> date "Saturday 31 July 2010 12:00:00 am"

You can use the list assignment trick to do this in one line, at least:

tell d to set {its month, its day, its month} to {1, 31, 7}
-->date "Saturday, July 31, 2010 12:00:00 AM"



--
Mark J. Reed <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

References: 
 >Rép: date/Snow Leopard changed (From: Yvan KOENIG <email@hidden>)
 >Re: Rép: date/Snow Leopard changed (From: Christopher Nebel <email@hidden>)
 >Re: Rép: date/Snow Leopard changed (From: Tim Mansour <email@hidden>)

  • Prev by Date: Re: load file statement not finding files with Snow Leopard (Brian Christmas)
  • Next by Date: documentation for Snow Leopard Quicktime?
  • Previous by thread: Re: Rép: date/Snow Leopard changed
  • Next by thread: Rép: date/Snow Leopard changed
  • Index(es):
    • Date
    • Thread