Re: current date - 1 day?
Re: current date - 1 day?
- Subject: Re: current date - 1 day?
- From: Graff <email@hidden>
- Date: Tue, 17 Feb 2004 02:31:02 -0500
The term "days" is actually a constant which is 86400 seconds (60
seconds * 60 minutes * 24 hours). When you do:
(day of current date) - (1 * days)
You are actually getting:
17 - 86400
Which equals -86383.
If you wanted yesterday as a day then you could say:
set yesterday to day of (current date - (1 * days))
- Ken
On Feb 17, 2004, at 1:59 AM, Stephen Schaefer wrote:
Probably simple newbie question, so hopefully a simple answer: why
does "yesterday" result in "-86383" instead of 16 (as in today is the
17th, so yesterday would be the 16th)? Thanks
set theDate to current date
set d to day of theDate
set m to month of theDate
set y to year of theDate
set ts to time string of theDate
set yesterday to (d) - (1 * days)
set mesg to "Here's info about today:" & return & ,
"time: " & ts & return & ,
"day: " & d & return & ,
"month: " & m & return & ,
"year: " & y & return & ,
"yesterday: " & yesterday & return
display dialog mesg
_______________________________________________
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.