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

Re: date/Snow Leopard changed


  • Subject: Re: date/Snow Leopard changed
  • From: "Mark J. Reed" <email@hidden>
  • Date: Sun, 6 Sep 2009 12:01:47 -0400

That doesn't work reliably, as has been pointed out earlier in this
thread.  If the current date is Sept 29, 2009, and you call that
handler as newDate(2,15,2010), then the result is March instead of
February.

You have to set either the month or the day to some value that can be
safely paired with any legal value of the other property, and only
then set the desired values.


On 9/6/09, Jon Pugh <email@hidden> wrote:
> At 7:27 AM -0400 9/6/09, Mark J. Reed wrote:
>>Can you construct an arbitrary date in one step without parsing a
>>string? "make new date with properties {year: y, month: m, day: d}"
>>maybe?
>
> on newDate(m, d, y)
> 	set new_date to current date
> 	set month of new_date to m
> 	set day of new_date to d
> 	set year of new_date to y
> 	set time of new_date to 0
> 	return new_date
> end newDate
>
> newDate(12, 25, 1973)
>
>
> Sure, it's not a one liner unless you only consider the subroutine call, but
> it should work everywhere, regardless.
>
> Jon
>  _______________________________________________
> 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
>

--
Sent from my mobile device

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

  • Follow-Ups:
    • Re: date/Snow Leopard changed
      • From: Deivy Marck Petrescu <email@hidden>
References: 
 >Re: date/Snow Leopard changed (From: Doug Tallman <email@hidden>)
 >Re: date/Snow Leopard changed (From: Yvan KOENIG <email@hidden>)
 >Re: date/Snow Leopard changed (From: LuKreme <email@hidden>)
 >Re: date/Snow Leopard changed (From: Yvan KOENIG <email@hidden>)
 >Re: date/Snow Leopard changed (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: date/Snow Leopard changed
  • Next by Date: new (I think) time question
  • Previous by thread: Re: date/Snow Leopard changed
  • Next by thread: Re: date/Snow Leopard changed
  • Index(es):
    • Date
    • Thread