Jump to content

Recommended Posts

Posted

How to u get only "hour:min" from system and compare it with time=hour:min in a inifile?

ex.. time=18:00

I keep getting lost when it comes to time functions.

//Regards L

 

Posted

@HOUR & ":" & @MIN

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

The macros @HOUR & @MIN, as well as the functions IniRead & StringInStr could probably be used to accommodate you here.

edit: oh I'm a slow typer!

i was thinking that but wasent sure when comparing they would be the same format or if one was just text and the other some date/time format?

Posted

As soon as you concatenate numbers with a character (":") the result is a string. IniRead returns a string too.

So no problem when comparing.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

If i vant to convert it, what do i do?  i would like to stop some services between lets say 03:00 and 07:00, the rest of the time its ok to run.

Posted

lgvlgv,

Convert what?  This will do something once every day between 03:00 and 07:00. 

local $flag = false     ; used to do action once

while 1

    if (@hour >= 03 and @hour <= 07) and $flag = false then
        $flag = true
        ;
        ; do your thing
        ;
    EndIf

    sleep(1000)

    if (@hour < 03 or @hour > 07) and $flag then $flag = not $flag

wend

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...