MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / get

Method get

projects/JavaScript/proto/fbe.js:1853–1860  ·  view source on GitHub ↗

* Get the timestamp value * @this {!FieldModelTimestamp} * @param {Date=} defaults Default value, defaults is new Date(0) * @returns {!Date} Result value

(defaults = new Date(0))

Source from the content-addressed store, hash-verified

1851 * @returns {!Date} Result value
1852 */
1853 get (defaults = new Date(0)) {
1854 if ((this._buffer.offset + this.fbeOffset + this.fbeSize) > this._buffer.size) {
1855 return defaults
1856 }
1857
1858 let nanoseconds = this.readUInt64(this.fbeOffset)
1859 return new Date(Math.round(nanoseconds / 1000000))
1860 }
1861
1862 /**
1863 * Set the timestamp value

Callers

nothing calls this directly

Calls 1

readUInt64Method · 0.45

Tested by

no test coverage detected