title: TimeBasedTriggeringPolicy log4j2 not rolling over when new day happens
body: <p>I have configured Log4j2 with the following configuration, but TimeBasedTriggeringPolicy is not working, I am getting new day logs in older day's logs, can you please help. It is rolling over properly with size and it is also creating any number of files since I have specified "nomax" attribute for DefaultRollOverStrategy, only TimeBasedTriggeringPolicy is not working. It writes logs of a day in the previous day's log file. It does create the new log file with the latest date, but some logs have been logged in to the previous day's log. May be getting problem in naming the files properly I do not know.</p>
  
  <pre><code>  {
    "Configuration": {
      "Properties": {
        "Property": [
          {
            "name": "application",
            "value": "myapp"
          }
        ]
      },
      "Appenders": {
        "Console": {
          "name": "Console-Appender",
          "target": "SYSTEM_OUT",
          "PatternLayout": {
            "pattern": "%d{yyyy-MM-dd HH:mm:ss,SSS} ${application} %-5level %marker %t %c{5}  %msg%n"
          },
           "ThresholdFilter": { "level": "error" }
        },
        "RollingFile": [
          {
            "name": "File-Appender",
            "fileName":"${sys:log.path}/${application}.log",
            "filePattern":"${sys:log.path}/${application}-%d{yyyy-MM-dd}-%i.log",
            "PatternLayout": {
              "pattern": "%d{yyyy-MM-dd HH:mm:ss,SSS} ${application} %-5level %marker %t %c{5}  %msg%n"
            },
            "Policies": {
              "TimeBasedTriggeringPolicy": {"interval":"1", "modulate":"true" },
               "SizeBasedTriggeringPolicy": { "size": "5 KB" } 
              },
              "DefaultRolloverStrategy": {"fileIndex":"nomax"}   
          }
        ]
      },
      "loggers": {
        "logger":{
          "name": "com.mycompany",
          "level": "${sys:log.level}",
          "AppenderRef": { "ref": "File-Appender"}
        },
        "root": {
          "level": "error",
          "AppenderRef": { "ref": "Console-Appender" }
        }
      }
    }
  }
  </code></pre>