Spring @DateTimeFormat is changing timezone while converting @PathVariable to Date
<p>I'm trying to use spring's automatic String to Date conversion when getting date as <code>@PathVariable</code> using <code>@DateTimeFormat</code>. The automatic conversion is done, but for some reason the date is converted to the date I passed minus four hours (Easter Daylight Time, where the server and client are both located).</p>

<p>Example:</p>

<p>URL: <code>.../something/04-10-2016/somename</code> Will result someDate object with value 2016/10/03 20:00:00 (i.e. 8 PM of the previous day, which is 4 hours behind the date I passed.)</p>

<p>How do I avoid this auto timezone conversion. I don't need any timezone information, and this conversion is breaking the behavior I expected.</p>

<p>Here's my code:</p>

<pre><code>@RequestMapping(value = "/something/{someDate}/{name}", method = RequestMethod.GET, headers = "Accept=application/json")
@ResponseBody
public SomeObject getDetails(@PathVariable @DateTimeFormat(pattern = "dd-MM-yyyy") Date someDate,
    @PathVariable String name) {
    // date here comes as GMT - 4
    // more code here
    // return someObject;
}
</code></pre>

<p>For I now, I'm working around this by just reading the path variable as a String and using SimpleDateFormatter to convert the String to Date manually.</p>

<p>Any idea on how I can get the auto conversion work without timezone conversion?</p>