Skip to content

AdarshHatkar/modern-time-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published