A simple npm package for common timestamp utility functions.
You can install modern-time-utils using npm:
npm install modern-time-utils
Returns the current timestamp in milliseconds.
import { getCurrentTimeStamp } from 'modern-time-utils';
const timeStamp = getCurrentTimeStamp();
console.log(`Current timestamp: ${timeStamp}`);
Returns the current timestamp in seconds.
import { getCurrentTimeStampInSeconds } from 'modern-time-utils';
const timeStampInSeconds = getCurrentTimeStampInSeconds();
console.log(`Current timestamp in seconds: ${timeStampInSeconds}`);
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.