E
Eric
I'm having a little difficulty with this one. I want to have a notify
script "not" send messages during a weekend "quiet window" from Friday
17:00 through Sunday 17:00. Sounds simple enough on the surface. I
just need an "okToSend()" function to return a True (1) if the
current date and time are not within that blackout window.
But .... how do you do this?
If the current epoch timestamp is $now = time; How do I determine if
it's within this blackout window? Not so simple. I've tried
calculating the start of week Monday, and then adding enough seconds
to determine Friday 17:00 and the same for Sunday 17:00 and then
seeing if the current timestamp is between these two numbers .... but
my code is not very elegant and this just feels like the wrong
approach.
Any suggestions?
Thanks,
Eric
script "not" send messages during a weekend "quiet window" from Friday
17:00 through Sunday 17:00. Sounds simple enough on the surface. I
just need an "okToSend()" function to return a True (1) if the
current date and time are not within that blackout window.
But .... how do you do this?
If the current epoch timestamp is $now = time; How do I determine if
it's within this blackout window? Not so simple. I've tried
calculating the start of week Monday, and then adding enough seconds
to determine Friday 17:00 and the same for Sunday 17:00 and then
seeing if the current timestamp is between these two numbers .... but
my code is not very elegant and this just feels like the wrong
approach.
Any suggestions?
Thanks,
Eric