INNER CODE UNIT · Java
SQL_TIME
oracle/pgql-lang · pgql-spoofax/src/main/strategies/pgqllang/strategies/DateTimeFormatters.java:23
public static final DateTimeFormatter SQL_TIME = new DateTimeFormatterBuilder() //
.appendValue(HOUR_OF_DAY, 2) //
.appendLiteral(':') //
.appendValue(MINUTE_OF_HOUR, 2) //
.appendLiteral(':') //
.appendValue(SECOND_OF_MINUTE, 2) //
.optionalStart() //
.appendFraction(NANO_OF_SECOND, 0, 9, true).toFormatter().withResolverStyle(ResolverStyle.STRICT);
/**
* Differences with DateTimeFormatter.ISO_LOCAL_DATE_TIME: - seconds are optional in ISO but not in SQL - date and
* time are separated by 'T' in ISO but by ' ' in SQL
*/
public static final DateTimeFormatter SQL_TIMESTAMP = new DateTimeFormatterBuilder() //
.append(SQL_DATE) //
.appendLiteral(' ') //
.append(SQL_TIME).toFormatter().withResolverStyle(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);