
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello Comunity,
I am hoping someone could assist with a logic problem i am having.
Overview
I would like to create a rule that alerts me if a use has logged in outside of the hours of 06:00-18:00 and if they login on at any time during Saturday and Sunday.
I have created a rule to isolate the logon event and an active list with the relevent users contained in it and the rule works briliantly and currently brings back logon events for the users defined in the active list but the problem i am having is with the variables to get the times and dates working.
How I think it should work
I would use the time stamp variables to "GetHour" as an interger so an interger between 0-23 which will be the current time.
I then use the variable to "GetDayOfWeek" which gives me an interger of 1-7.
My question is once i have these variables how do i convert the endtime of the event to an interger so that i may compare the day and the hour to the variables i have previously.
Also once i have changed the "endtime" to a interger i am assuming i can then specify in the conditions endtime > 18 and endtime < 6 which should give me only the events between 06:00 and 18:00.
Has anyone does this before?
Am i on the right track?
Thanks for your assistance.
Regards
Oliver
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello!
Try to do this as in the screenshot.
GetDayOfWeek and CurrentHour are local variables.
GetDayOfWeek it's GetDayOfWeek function.
CurrentHour it's GetHour function.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello Oliver,
Yes, you are on the right tarck 🙂
Just keep the condition as
endTime > 18 OR endTime < 6 . This will work.
And endTime here is the variable name you have created to extract the hour from the End Time. Better to keep the varaible name other than endTime here 🙂
Regards,
Sumanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks Sumanth,
The hour part of the rule is working great, thanks.
Do you know how best to include the saturday and sunday part of the rule into this?
For example i would like to be emailed of a user logs in on a saturday or sunday so the time requirement is irrelevant here.
I was thinking a seperate rule may be the most efficiant way to accomplish this but i am eager to here your take on this.
Oliver


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello!
Try to do this as in the screenshot.
GetDayOfWeek and CurrentHour are local variables.
GetDayOfWeek it's GetDayOfWeek function.
CurrentHour it's GetHour function.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks, worked a treat