-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
questionFurther information is requestedFurther information is requested
Description
In the latest version, 3.21.4
, the Timestamp.toObject()
function isn't working correctly.
Previously it would return the timestamp as an object with keys for seconds
and milliseconds
. However now it is returning zero values for both.
This is a function where I noticed the issue, I've added some logging which pointed out toObject()
as being the problem.
function dateToTs(date: Date): Timestamp {
const ts = new Timestamp();
ts.fromDate(date);
console.log(
"date:",
date,
"timestamp:",
ts.getSeconds(),
ts.getNanos(),
ts.toObject(),
);
return ts;
}
See the screenshot below for the resulting console log, where you can see the seconds and milliseconds are set, but the toObject
return is zeroed
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested