Timestamp timeStampFromDateTime(DateTime dt) { final millis = dt.millisecondsSinceEpoch; return Timestamp( seconds: Int64(millis ~/ 1000), nanos: (millis % 1000) * 1000000); }