public static Timestamp fromEpoch ( long epochMillis ) { return Timestamp . newBuilder ( ) . setNanos ( ( int ) ( ( epochMillis % MILLIS_PER_SECOND ) * NANOS_PER_MILLI ) ) . setSeconds ( epochMillis / MILLIS_PER_SECOND ) . build ( ) ; }
Obtain the current time from the unix epoch