Have ideas to improve npm?Join in the discussion! »

    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

    23

    Version

    1.1.3

    License

    ISC

    Unpacked Size

    3.42 kB

    Total Files

    3

    Last publish

    Collaborators

    • avatar