Re:Date mathematics help please
Re:Date mathematics help please
- Subject: Re:Date mathematics help please
- From: roy whelden <email@hidden>
- Date: Sat, 18 Jan 2003 17:25:07 -0800
Hello SA,
Dates are very convenient to work with in Applescript. Here is an
example which should answer your question.
-------------------------------
set x to date "Tuesday, January 14, 2003 12:00:00 AM"
set y to date "Friday, January 17, 2003 12:00:00 AM"
set z to y - x --this returns the difference in seconds
set hoursDifference to z div hours --(1) use div to return an integer;
(2) hours is an Applescript constant. Days,weeks, and minutes are also
Applescript constants
display dialog "The difference is " & hoursDifference & " hours."
----------------------------
Hope this helps,
RMW
_______________________________________________
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.