storj/web/satellite/src/utils/time.ts

11 lines
257 B
TypeScript
Raw Normal View History

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
/**
* toUnixTimestamp converts Date to unix timestamp.
* @param time
*/
export function toUnixTimestamp(time: Date): number {
return Math.floor(time.getTime() / 1000);
}