Search code examples
apachedateexpressionlocalexpr

Apache 2.4 Date Expressions


Pre Apache 2.4 I could write this

<!--#config timefmt="%Y%m%d %T" -->
<!--#if expr="($DATE_LOCAL > 20170311 00:00:01) && ($DATE_LOCAL < 20170316 00:00:01)"-->
Show this text during the specified Date/Time
<!--#endif-->

I have tried several different ways....but I can't seem to get this to work in Apache 2.4.

I can get it to work if I turn the "SSILegacyExprParser on" ....however I would like to get this working without turning that on in Apache 2.4.

Can anyone help with the correct syntax needed?


Solution

  • Ok....I was able to figure this out....and seemed to test fine in Apache 2.4

    <!--#config timefmt="%Y%m%d %T" -->
    <!--#if expr="(v('DATE_LOCAL') > '20170311 00:00:01') && (v('DATE_LOCAL') < '20170316 00:00:01')"-->
    Show this text during the specified Date/Time
    <!--#endif-->