VCL condition for time of day

Answered

Comments

2 comments

  • Official comment
    Todd

    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 Permalink
  • Nik Ambrosch

    This is perfect, thank you Todd

    0
    Comment actions Permalink

Please sign in to leave a comment.