Posts: 42
Threads: 23
Joined: Oct 2008
Hi,
Is it possible to check what time it is on the machine the macro is running and do an action if the time between 8am-5pm and another action if it is outside of this time?
Thanks,
Paul.
Posts: 12,071
Threads: 140
Joined: Dec 2002
Macro
DATE d1.getclock d2("8:00 AM") d3("5:00 PM")
_i=d1.date; d1.date=d1.date-_i ;;get time part
if(d1.date>=d2.date and d1.date<d3.date)
,out "time between 8:00 AM and 5:00 PM"
else
,out "other time"
Posts: 42
Threads: 23
Joined: Oct 2008
Thanks Gintaras,
I tired this and it worked before 12PM, but now it deoesn't work and shows the time as being "other time", even though it is 12:43PM and within 8AM-5PM.
Can you see what could be causing it to think it is outside of 8AM-5PM?
Posts: 12,071
Threads: 140
Joined: Dec 2002
Now corrected. It was because _i=d1 rounds up.
Posts: 42
Threads: 23
Joined: Oct 2008
Thanks Gintaras, worked a treat!