java.lang.Object
org.yamcs.utils.TimestampUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.protobuf.Timestampstatic com.google.protobuf.Timestampjava2Timestamp(long timeMillisec) Converts java time in milliseconds to protobuf Timestampstatic longtimestamp2Java(com.google.protobuf.Timestamp ts) Converts protobuf Timestamp into java time in milliseconds Note: this loses precision (nanoseconds to milliseconds)
-
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:
-