Re: countdown to failiure
Re: countdown to failiure
- Subject: Re: countdown to failiure
- From: Michelle Steiner <email@hidden>
- Date: Sun, 11 Mar 2001 22:18:35 -0800
On 3/11/01 9:24 PM, Jason Ryant <email@hidden> wrote:
>
hi all. i would like to build a simplistic script consisting of two
>
variables: 1. the current date and time and, 2. the date and time
>
specified by the user. what i would like to happen is for the user to
>
specify a date [lets say new year's] and for the script to tell the user
>
how much time there is until then.
I entered "Dec 1, 2004" into the dialog in the followin script
display dialog "please enter the date to track." default answer ""
set datetotrack to text returned of the result
set the datetime to date datetotrack
set timeremaining to datetime - (current date)
set theAnswer to "There are " & timeremaining & " seconds remaining until
" & datetime
--> "There are 117510571 seconds remaining until Wednesday, December 1,
2004 12:00:00 AM"
If you enter a month and day without a year, it assumes the current year.
If you enter only a month, it assumes the first day of that month of the
current year.
If you enter only a number, it assumes that day of the current month of
the current year (giving an error if the day is out of range).
If you enter the name of a day (or any other alpha text), it gives an
error.
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------