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

16 lines
363 B
TypeScript
Raw Normal View History

// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
/**
* Time holds methods to operate over timestamps.
*/
export class Time {
/**
* toUnixTimestamp converts Date to unix timestamp.
* @param time
*/
public static toUnixTimestamp(time: Date): number {
return Math.floor(time.getTime() / 1000);
}
}