modern-time-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

modern-time-utils

A simple npm package for common timestamp utility functions.

Installation

You can install modern-time-utils using npm:

 npm install modern-time-utils

Usage

getCurrentTimeStamp(): number

Returns the current timestamp in milliseconds.

import { getCurrentTimeStamp } from 'modern-time-utils';

const timeStamp = getCurrentTimeStamp();
console.log(`Current timestamp: ${timeStamp}`); 

getCurrentTimeStampInSeconds(): number

Returns the current timestamp in seconds.

import { getCurrentTimeStampInSeconds } from 'modern-time-utils';

const timeStampInSeconds = getCurrentTimeStampInSeconds();
console.log(`Current timestamp in seconds: ${timeStampInSeconds}`);

Contributing

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.

License

MIT

Package Sidebar

Install

npm i modern-time-utils

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

4.42 kB

Total Files

7

Last publish

Collaborators

  • adarshhatkar