Class TimestampUtil


  • public class TimestampUtil
    extends Object
    • Constructor Detail

      • TimestampUtil

        public TimestampUtil()
    • Method Detail

      • currentTimestamp

        public static com.google.protobuf.Timestamp currentTimestamp()
        Returns:
        current (now) protobuf timestamp
      • java2Timestamp

        public static com.google.protobuf.Timestamp java2Timestamp​(long timeMillisec)
        Converts java time in milliseconds to protobuf Timestamp
        Parameters:
        timeMillisec - java timestamp to be converted
        Returns:
      • timestamp2Java

        public static long timestamp2Java​(com.google.protobuf.Timestamp ts)
        Converts protobuf Timestamp into java time in milliseconds Note: this loses precision (nanoseconds to milliseconds)
        Parameters:
        ts - protobuf timestamp to be converted
        Returns: