Class TimestampBuilder
java.lang.Object
org.phenopackets.phenopackettools.builder.builders.TimestampBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.protobuf.Timestampbuild()static com.google.protobuf.TimestampfromInstant(Instant instant) static com.google.protobuf.TimestampfromISO8601(String time) Accepts strings like 2021-10-01T18:58:43Z (also valid RFC3339) OR an ISO date time e.g.static com.google.protobuf.TimestampfromISO8601LocalDate(String date) Accepts strings with the ISO8601 date format e.g.static com.google.protobuf.Timestampnow()static com.google.protobuf.Timestampseconds(long seconds) static com.google.protobuf.Timestamptimestamp(int y, int m, int d) static com.google.protobuf.Timestamptimestamp(int y, int m, int d, int h, int min)
-
Constructor Details
-
TimestampBuilder
public TimestampBuilder(long seconds)
-
-
Method Details
-
build
public com.google.protobuf.Timestamp build() -
seconds
public static com.google.protobuf.Timestamp seconds(long seconds) -
now
public static com.google.protobuf.Timestamp now() -
timestamp
public static com.google.protobuf.Timestamp timestamp(int y, int m, int d) -
timestamp
public static com.google.protobuf.Timestamp timestamp(int y, int m, int d, int h, int min) -
fromInstant
-
fromISO8601LocalDate
Accepts strings with the ISO8601 date format e.g. 2021-10-01 and returns a timestamp for midnight UTC of that day.- Parameters:
date- a string such as 2021-10-01- Returns:
- corresponding protobuf Timestamp object
-
fromISO8601
Accepts strings like 2021-10-01T18:58:43Z (also valid RFC3339) OR an ISO date time e.g. 2021-11-05 which will return a timestamp for midnight UTC of that day.- Parameters:
time- a string such as 2021-10-01T18:58:43Z- Returns:
- corresponding protobuf Timestamp object
-