public static DateFormat newUtcFormatter() { TimeZone tz = TimeZone.getTimeZone("UTC"); ISO8601DateFormat df = new ISO8601DateFormat(); df.setTimeZone(tz); return df; } }
private ObjectWriter createObjectWriter() { final ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setSerializationInclusion(Include.NON_EMPTY); final ISO8601DateFormat df = new ISO8601DateFormat(); df.setTimeZone(TimeZone.getTimeZone("UTC")); objectMapper.setDateFormat(df); objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); return objectMapper.writer(); } }
configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); ISO8601DateFormat dateFormat = new ISO8601DateFormat(); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); setDateFormat(dateFormat); SimpleModule deserializerModule =
configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); ISO8601DateFormat dateFormat = new ISO8601DateFormat(); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); setDateFormat(dateFormat); SimpleModule deserializerModule =
@Bean public ObjectMapper objectMapper() { final ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new GuavaModule()); objectMapper.setSerializationInclusion(Include.NON_NULL); final ISO8601DateFormat df = new ISO8601DateFormat(); df.setTimeZone(TimeZone.getTimeZone("UTC")); objectMapper.setDateFormat(df); objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); objectMapper.addMixIn(CollectionResource.class, CollectionResourceMixin.class); objectMapper.addMixIn(SnomedComponent.class, ISnomedComponentMixin.class); objectMapper.addMixIn(ISnomedBrowserComponent.class, ISnomedComponentMixin.class); objectMapper.addMixIn(Branch.class, BranchMixin.class); objectMapper.addMixIn(Metadata.class, MetadataMixin.class); objectMapper.addMixIn(MetadataHolder.class, MetadataHolderMixin.class); objectMapper.addMixIn(Review.class, ReviewMixin.class); objectMapper.addMixIn(MergeReview.class, MergeReviewMixin.class); objectMapper.addMixIn(BranchState.class, BranchStateMixin.class); objectMapper.addMixIn(ConceptChanges.class, ConceptChangesMixin.class); return objectMapper; }