npm

Need private packages and team management tools?Check out npm Orgs. »

simple-datetime-formater

1.1.3 • Public • Published

A very simple DateTime library to convert timestamp to human readable time.

size: 1.31kb

Something I use all the time and don't want to repeat it all the time.

Usage:

Format Date:

const simpleDatetimeFormater = require("simple-datetime-formater"
 
simpleDateTimeFormater.formatDate(timestamp)
 

Format Time:

const simpleDatetimeFormater = require("simple-datetime-formater"
 
simpleDateTimeFormater.formatTime(timestamp)
 

timestamp or ISO time string parameter is optional. You can use it when necessary.

timeago

const simpleDatetimeFormater = require("simple-datetime-formater"
 
simpleDateTimeFormater.formatTimeAgo(timestamp)
 

to use this package over in the frontend here is the cdn:

<script src="https://cdn.jsdelivr.net/gh/rexeze/formatTimeStamp/src/index.min.js"></script>

In timeago you must put a time stamp or ISO time string.

This package solves my problem for now. I will continue to develop it to something more robust to suit any use case if necessary.

Keywords

none

install

npm i simple-datetime-formater

Downloadsweekly downloads

54

version

1.1.3

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability