VCL condition for time of day
AnsweredI'm looking to create logic like this in VCL but haven't been able to figure it out, anyone have an idea?
if time of request starts 8am-5pm then {do something}
otherwise {do something else}
Thanks.
-
Official comment
Hi Nik,
Here's an example:
declare local var.hour_start INTEGER; set var.hour_start = std.atoi(strftime({"%H"}, time.start)); if (var.hour_start >= 8 && var.hour_start < 17) { log "business hours"; } else { log "not business hours"; }
Here's a link to a fiddle that shows this logic in action - https://fiddle.fastlydemo.net/fiddle/f1ae88a9.
Comment actions
Please sign in to leave a comment.
Comments
2 comments