List of usage examples for java.time OffsetDateTime toLocalDateTime
public LocalDateTime toLocalDateTime()
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); LocalDateTime l = o.toLocalDateTime(); System.out.println(l);/*from w w w . j av a 2s . co m*/ }
From source file:org.openmhealth.schema.serializer.Rfc3339OffsetDateTimeSerializer.java
@Override public void serialize(OffsetDateTime instant, JsonGenerator generator, SerializerProvider provider) throws IOException { StringBuilder builder = new StringBuilder(); builder.append(instant.toLocalDateTime().toString()); if (instant.getSecond() == 0 && instant.getNano() == 0) { builder.append(":00"); }//from w w w.jav a 2 s . c o m builder.append(instant.getOffset().toString()); generator.writeString(builder.toString()); }