Skip to content

Instantly share code, notes, and snippets.

@znbailey
Last active December 16, 2015 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save znbailey/5499954 to your computer and use it in GitHub Desktop.
Save znbailey/5499954 to your computer and use it in GitHub Desktop.
trying to get ISO8601 dates in dropwizard JSON
@Override
public void run(ApiServiceConfiguration config, Environment env) throws Exception {
...
// works
env.getObjectMapperFactory().setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"));
// works
env.getObjectMapperFactory().setDateFormat(new ISO8601DateFormat.getInstance());
// doesn't work
env.getObjectMapperFactory().setDateFormat(ISO8601DateFormat.getInstance());
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment