• 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: Some date math
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some date math


  • Subject: Re: Some date math
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 24 Feb 2003 18:22:54 -0700

On Monday, February 24, 2003, at 05:56 PM, John Delacour wrote:

Does anyone know how to get the date of yesterday.
3get current date2 will get the current day. Fine.
3get current date - 1 displays also the current date. So what can I do?

(current date) - (60 * 60 * 24)

Why do all that math?

Applescript has predefined time values.

minutes = 60
hours = 3600
days = 86400
weeks = 604800

For example, the time two weeks, three days, five hours, nine minutes, and ten seconds from now can be expressed as

current date + 2 * weeks + 3 * days + 5 * hours + 9 * minutes + 10
--> date "Thursday, March 13, 2003 11:30:04 PM"

--
"There's some good in the world, Mr. Frodo, and it's worth fighting for."
_______________________________________________
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: 
 >Re: Some date math (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Archiving Mailbox contents
  • Next by Date: Re: Scripting Mail:get selection
  • Previous by thread: Re: Some date math
  • Next by thread: Re: Some date math
  • Index(es):
    • Date
    • Thread