How to compare dates using Spring Expression Language?
<p>Can anyone give me any examples of how to compare Dates using Spring Expression Languange (Spel)?</p>

<p>I have searched far and wide and nothing I find seems to fit my purpose. I'm using Java 8 and I have a response Object with a ZonedDateTime field which I somehow need to compare to a string in the form of YYYY-MM-DD -- IE: is before, is after, is equal, etc.</p>

<pre><code>ZonedDateTime zonedDateTime = ZonedDateTime.now(ZoneId.systemDefault());
HashMap&lt;String, Object&gt; testHash = new HashMap&lt;&gt;();
testHash.put("dateField", zonedDateTime);

ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();
context.setVariables(testHash);

Expression expression = parser.parseExpression("#dateField &gt; '2016-01-01'");
</code></pre>

<p>The above is obviously not working. Anyone able to show me an example that does?</p>