Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Unable to persist dates before January 1st 1970 #29

Open
@etibarhasanov

Description

@etibarhasanov

Dates values are currently handled in the following fashion:

  private  static Timestamp toTimestamp(Date date) {
    final long millis = date.getTime();
    return Timestamp
        .newBuilder()
        .setSeconds(millis / 1000)
        .setNanos((int) ((millis % 1000) * 1000000))
        .build();
  }

This results in the nanosecond value being a negative number if the supplied date is earlier than January 1st 1970.

However, according to Protobuf documentation, the accepted values are from 0 to 999,999,999 inclusive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions