Forum Discussion
I forgot to add, this would need to trigger TRUE within the 6:00 hour only M-F, not weekends.
------------------------------
Scott Dye
------------------------------
You can use strftime with something like this so it's nice and easy to read:
%w returns the weekday index with Sunday = 0 and Saturday = 6 so those are omitted, and then %-H returns the current 24 hour value of the current time. Keep in mind that Pipelines runs on UTC time for conversions so you need to convert 6:00 AM to UTC time for your filter. 6AM EST is 11AM UTC so you would put 11 instead of 19 from my screenshot.
------------------------------
Chayce Duncan
------------------------------
- ScottDye2 years agoQrew Trainee
This is great. Thanks! For reference if anyone tries this, the 'weekday' check also assumes UTC time, so the start of the day does not match the start of my day. In my case, that was not really a big deal, but wanted to mention it.
------------------------------
Scott Dye
------------------------------ - ScottDye2 years agoQrew Trainee
One caveat to this - this code does not adjust for daylight savings time. It was skipping at 6am, but now is skipping at 7am. I may just have to adjust this manually twice a year, or come up with another option.
------------------------------
Scott Dye
------------------------------- DougHenning12 years agoCommunity Manager
You can specify a timezone when referencing the date/time which should help:
{{ time.now | timezone('America/Los_Angeles') }}
With that, you can adjust your expressions:
The "weekday()" function returns 0 for Monday, so you can use a single expression to skip weekends.
------------------------------
Doug Henning
------------------------------