I have a property set in a script for date time stamp.
property endDate : “Friday, August 26, 2005 9:33:10 AM”
set the finishDate to date the endDate
set cDATE to current date
if cDATE > thedate then
display dialog “Program has expired”
display dialog "Program is ready to run
–some other code here
Because the system clock can be reset by the user.
I thought I could get the time from a web based clock.
curl would seem to be the way to go
But my knowledge of shell scripting is very limited.
Appreciate any help
all you need is a formated date on a webserver. I used PHP to have a current date.
-- formated PHP script
-- $currentTime = date('l, F j,Y g:i:s A');
-- echo $currentTime;
property theURL : "http://www.domain.com/path/to/time/file.php"
--set theEndDate to ((current date) + 2592000) as text
set theEndDate to "Friday, October 7, 2005 12:48:16 PM"
tell application "System Events"
set theCurrentTime to do shell script "curl " & theURL
if theCurrentTime > theEndDate then
return "program active"
else if theCurrentTime < theEndDate then
return "program disabled"