📜  时间戳 firebase - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:19.593000             🧑  作者: Mango

代码示例2
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.

long millis = System.currentTimeMillis();

Timestamp timestamp = 
  Timestamp.newBuilder()
           .setSeconds(millis / 1000)
           .setNanos((int)(millis % 1000 * 1_000_000))
           .build();