You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation is incorrect/confusing for Timestamp.parseTimestamp #4583
/** * Creates a Timestamp instance from the given string. String is in the RFC 3339 format without * the timezone offset (always ends in "Z"). */publicstaticTimestampparseTimestamp(Stringtimestamp) {
Instantinstant = Instant.parse(timestamp);
returnofTimeSecondsAndNanos(instant.getEpochSecond(), instant.getNano());
}
But if we look at the code for org.threeten.bp.Instant.parse:
/** * Obtains an instance of {@code Instant} from a text string such as * {@code 2007-12-03T10:15:30.000Z}. * <p> * The string must represent a valid instant in UTC and is parsed using * {@link DateTimeFormatter#ISO_INSTANT}. * * @param text the text to parse, not null * @return the parsed instant, not null * @throws DateTimeParseException if the text cannot be parsed */publicstaticInstantparse(finalCharSequencetext) {
returnDateTimeFormatter.ISO_INSTANT.parse(text, Instant.FROM);
}
This implies to me that per the Google Cloud Timestamp documentation the following should work:
Timestamp.parseTimestamp("2019-01-23T12:30:00")
But it generates:
org.threeten.bp.format.DateTimeParseException: Text '2019-01-23T12:30:00' could not be parsed at index 19
It also would imply to me that the following shouldn't work:
Activity
sduskis commentedon Feb 28, 2019
@pmakani, can you please take a look at this?
pmakani commentedon Feb 28, 2019
@sduskis working on this.