fix(#4546) Added Math.trunc to toSecondsFromEpoch to conform the result to u64 (#4575)

This commit is contained in:
Parker Gabel 2020-04-03 12:20:40 -07:00 committed by GitHub
parent 2426174485
commit 0db04d6a42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 1 deletions

View file

@ -2,7 +2,7 @@
import { sendSync, sendAsync } from "../dispatch_json.ts";
function toSecondsFromEpoch(v: number | Date): number {
return v instanceof Date ? v.valueOf() / 1000 : v;
return v instanceof Date ? Math.trunc(v.valueOf() / 1000) : v;
}
export function utimeSync(