Custom Date Format

The REST API uses the default date format yyyy-MM-dd'T'HH:mm:ss which represents a date without milliseconds and timezone information, eg 2016-01-25T13:33:42. A custom date format can be configured in the web.xml file of the REST API. Therefore the ServletContextListener CustomJacksonDateFormatListener has to be added. The custom date format can be specified by the context parameter

For example, if the date format should contain milliseconds and timezone information (yyyy-MM-dd'T'HH:mm:ss.SSSZ) the following configuration can be used.

To achieve this, you can edit the WEB-INF/web.xml file as follows:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns=""

  <!-- ... -->



  <!-- ... -->

With this configuration the REST API will return dates with millisecond precision and timezone information. Also, new dates, with milliseconds and timezone information, can be submitted to the REST API without losing these details.

On this Page: