AllSystemGo Posted October 19, 2006 Posted October 19, 2006 (edited) Ok I'm just trying to figure out something here... I have something that starts my script every 30 minutes. I need to put in my code something that's going to tell him to from 08:00:00 to 16:30:00 run else you don't do anything... Basically I need to know how to compare time, like the current time with a given one. Cheers M8 PS: Kinda like $StartTime = "08:00:00" $EndTime = "16:30:00" IF _NowTime(5) > $StartTime or _NowTime(5) < $EndTime THEN .... ELSE Exit ENDIF Edited October 19, 2006 by AllSystemGo
BitRot Posted October 19, 2006 Posted October 19, 2006 (edited) Basically I need to know how to compare time, like the current time with a given one.Look at the chapter "Macro Reference - Time And Date". You can stick your own time and/or date together there (suggestion : @hour&":"&@min&":"&@sec), and compare with the string you showed us. So, whats the problem (apart from not knowing that AutoIt has got an extensive Help available) ? [edit] I did not really notice you allready named a command to retrieve the time : "_NowTime(...)". If you've got that, what than is the problem ? Did you try if it would work ? And if so, how did it not work ? What you posted should work. Yes, you can compare those two time-strings as they are, as the letter "3" is lower than the letter "4", just as the value 3 is lower than the value 4. Edited October 19, 2006 by BitRot
Ed_Maximized Posted October 19, 2006 Posted October 19, 2006 Ok I'm just trying to figure out something here... I have something that starts my script every 30 minutes. I need to put in my code something that's going to tell him to from 08:00:00 to 16:30:00 run else you don't do anything... Basically I need to know how to compare time, like the current time with a given one. Cheers M8 PS: Kinda like $StartTime = "08:00:00" $EndTime = "16:30:00" IF _NowTime(5) > $StartTime or _NowTime(5) < $EndTime THEN .... ELSE Exit ENDIF Try this IF _TimeToTicks() >= _TimeToTicks("08","00","00") And _TimeToTicks() <= _TimeToTicks("16","30","00") THEN ;do something ELSE ;do something else Exit ENDIF Ed ShapedGUI Creator : Shaped gui the easy way!!!Txt2au3 : the easy way to include text files into your program without fileinstall_GUICreateWithTiledBackground : Put a GIF in the background of your formsSQLite Database BrowserAnimated GIF UDF : Put animations in your GUI's
AllSystemGo Posted October 19, 2006 Author Posted October 19, 2006 Thxs to both of you guys. I really appreciate.. BTW BitRot not because I am asking a question that seem dumb to you thats mean that I didn't read the help section before posting!!! I'll try both of your suggestions!!!! Cheers
BitRot Posted October 19, 2006 Posted October 19, 2006 Thxs to both of you guys. I really appreciate..You're welcome BTW BitRot not because I am asking a question that seem dumb to you thats mean that I didn't read the help section before posting!!! Yep, that was what I was thinking If I was mistaken I appologize. Please, next time just try it. That code was/is not harmfull in any way, so that should not hold you back. And, to be honest, I still have absolutily no idea what your problem with that code actually was/is
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now