Class ProtoTimestamps
- java.lang.Object
-
- org.curioswitch.common.server.framework.util.ProtoTimestamps
-
public final class ProtoTimestamps extends java.lang.ObjectCommon utilities for dealing withTimestamp, such as conversion tojava.timetypes.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.protobuf.TimestampfromInstant(java.time.Instant instant)Converts aInstanttoTimestamp.static com.google.protobuf.TimestampfromLocalDate(java.time.LocalDate localDate, java.time.ZoneOffset zone)Converts aLocalDatetoTimestamp.static com.google.protobuf.TimestampfromLocalDateTime(java.time.LocalDateTime localDateTime, java.time.ZoneOffset zone)Converts aLocalDateTimetoTimestamp.static java.time.InstanttoInstant(com.google.protobuf.Timestamp timestamp)Converts aTimestamptoInstant.static java.time.LocalDatetoLocalDate(com.google.protobuf.Timestamp timestamp, java.time.ZoneOffset zone)Converts aTimestamptoLocalDate.static java.time.LocalDateTimetoLocalDateTime(com.google.protobuf.Timestamp timestamp, java.time.ZoneOffset zone)Converts aTimestamptoLocalDateTime.
-
-
-
Method Detail
-
toLocalDateTime
public static java.time.LocalDateTime toLocalDateTime(com.google.protobuf.Timestamp timestamp, java.time.ZoneOffset zone)Converts aTimestamptoLocalDateTime.
-
fromLocalDateTime
public static com.google.protobuf.Timestamp fromLocalDateTime(java.time.LocalDateTime localDateTime, java.time.ZoneOffset zone)Converts aLocalDateTimetoTimestamp.
-
toLocalDate
public static java.time.LocalDate toLocalDate(com.google.protobuf.Timestamp timestamp, java.time.ZoneOffset zone)Converts aTimestamptoLocalDate. This will be the date that includes theTimestamp.
-
fromLocalDate
public static com.google.protobuf.Timestamp fromLocalDate(java.time.LocalDate localDate, java.time.ZoneOffset zone)Converts aLocalDatetoTimestamp. This will be theTimestampat the start of the day.
-
toInstant
public static java.time.Instant toInstant(com.google.protobuf.Timestamp timestamp)
Converts aTimestamptoInstant.
-
fromInstant
public static com.google.protobuf.Timestamp fromInstant(java.time.Instant instant)
Converts aInstanttoTimestamp.
-
-