GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Documentation is incorrect/confusing for Timestamp.parseTimestamp · Issue #4583 · googleapis/google-cloud-java

Documentation is incorrect/confusing for Timestamp.parseTimestamp #4583

New issue
Copy link
New issue
Copy link
Closed
Closed
Documentation is incorrect/confusing for Timestamp.parseTimestamp#4583
Copy link
Assignees
pmakani
Labels
api: corepriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@dclements
dclements
opened on Feb 27, 2019
Issue body actions

The code currently in master is:

/**
   * Creates a Timestamp instance from the given string. String is in the RFC 3339 format without
   * the timezone offset (always ends in "Z").
   */
  public static Timestamp parseTimestamp(String timestamp) {
    Instant instant = Instant.parse(timestamp);
    return ofTimeSecondsAndNanos(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
     */
    public static Instant parse(final CharSequence text) {
        return DateTimeFormatter.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:

Timestamp.parseTimestamp("2019-01-23T12:30:00Z")

Activity

  1. yoshi-automation
    added
    triage meI really want to be triaged.
    on Feb 28, 2019
  2. sduskis
    added
    type: docsImprovement to the documentation for an API.
    and removed
    triage meI really want to be triaged.
    on Feb 28, 2019
  3. sduskis commented on Feb 28, 2019

    @sduskis
    sduskis
    on Feb 28, 2019
    Contributor
    More actions

    @pmakani, can you please take a look at this?

  4. pmakani commented on Feb 28, 2019

    @pmakani
    pmakani
    on Feb 28, 2019
    More actions

    @sduskis working on this.

  5. pmakani
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    api: core
    and removed
    type: docsImprovement to the documentation for an API.
    on Mar 7, 2019
  6. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨 criticalP0 critical issue. Requires immediate fix
    on Mar 7, 2019
  7. pmakani
    self-assigned this
    on Mar 7, 2019
  8. pmakani
    removed
    triage meI really want to be triaged.
    🚨 criticalP0 critical issue. Requires immediate fix
    on Mar 7, 2019
  9. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨 criticalP0 critical issue. Requires immediate fix
    on Mar 7, 2019
  10. sduskis
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    🚨 criticalP0 critical issue. Requires immediate fix
    triage meI really want to be triaged.
    on Mar 7, 2019
  11. sduskis
    closed this as completedin #4656on Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @pmakani
    pmakani

Labels

api: corepriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.