• 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: Specific Date-Time Formatting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specific Date-Time Formatting


  • Subject: Re: Specific Date-Time Formatting
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 3 Nov 2005 17:17:43 -0700


On Nov 3, 2005, at 4:57 PM, Dave Lyons wrote:

Hi All, I found this in the archive and wanted to know if there was an option to get the date from two days in the future. I'm trying to make script that will look ahead for what the month and day will be in numerical format. I'm using the shell script "date" to get the current date, but I want to get that same info as + 2 days.

Does anybody know how to do this? I like the terminal / shell options rather than changing the text item delimiters, sorting out, etc. But you gotta work with what you have.

I don't know how to do it with shell-script stuff like you asked, but the following works in 10.4.3:


	set dayAfterTomorrow to (current date) + (60 * 60 * 24 * 2)
	set m to month of dayAfterTomorrow as integer
	set d to day of dayAfterTomorrow

why not this:

set dayAfterTomorrow to (current date) + 2 * days
set {m, d} to {month, day} of dayAfterTomorrow

Applescript has built-in values of minutes, hours, days, and weeks; how come so few people use them, but rather use the explicit numbers that these values represent?

--
The invasion of Iraq is "a catastrophic success"
-- G.W. Bush, August 29, 2004

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Specific Date-Time Formatting (From: Chris Tangora <email@hidden>)
 >Re: Specific Date-Time Formatting (From: Dave Lyons <email@hidden>)

  • Prev by Date: Re: Specific Date-Time Formatting
  • Next by Date: Release notes for AS 1.10.3 (OS X 10.4.3)
  • Previous by thread: Re: Specific Date-Time Formatting
  • Next by thread: Re: Specific Date-Time Formatting
  • Index(es):
    • Date
    • Thread