Работа со временем Unix Timestamp

export function timestamp(from) {
	if (from === void 0) return Math.floor(Date.now()/1000);
	if (!(from instanceof Date)) throw new TypeError("argument `from` is not valid date object");
	return Math.floor(from/1000);
}
 
export function dateFromUnix(timestamp) {
	return new Date(timestamp * 1000);
}