You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Yixiao Shen (Jira)" <ji...@apache.org> on 2022/05/31 23:56:00 UTC
[jira] [Created] (BEAM-14541) Timestamp value conversion in Cloud Datastore connector is wrong
Yixiao Shen created BEAM-14541:
----------------------------------
Summary: Timestamp value conversion in Cloud Datastore connector is wrong
Key: BEAM-14541
URL: https://issues.apache.org/jira/browse/BEAM-14541
Project: Beam
Issue Type: Bug
Components: io-java-gcp
Reporter: Yixiao Shen
Assignee: Yixiao Shen
Code in org.apache.beam.sdk.io.gcp.datastore.EntityToRow class:
{code:java}
com.google.protobuf.Timestamp time = val.getTimestampValue();
long millis = time.getSeconds() * 1000 + time.getNanos() / 1000;
return Instant.ofEpochMilli(millis).toDateTime();{code}
1 millisecond = 1,000,000 nanoseconds
--
This message was sent by Atlassian Jira
(v8.20.7#820007)