Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check time?
#1
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.
#2
Macro
Code:
Copy      Help
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"
#3
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?
#4
Now corrected. It was because _i=d1 rounds up.
#5
Thanks Gintaras, worked a treat! Big Grin


Forum Jump:


Users browsing this thread: 1 Guest(s)