Class TimestampUtil

java.lang.Object
org.yamcs.utils.TimestampUtil

public class TimestampUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.google.protobuf.Timestamp
     
    static com.google.protobuf.Timestamp
    java2Timestamp(long timeMillisec)
    Converts java time in milliseconds to protobuf Timestamp
    static long
    timestamp2Java(com.google.protobuf.Timestamp ts)
    Converts protobuf Timestamp into java time in milliseconds Note: this loses precision (nanoseconds to milliseconds)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TimestampUtil

      public TimestampUtil()
  • Method Details

    • 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: