Nerdy Programmers Mingling

    date-in-utc

    0.0.2 • Public • Published

    date-in-utc

    Convert date with UTC offset

    Install

    $ yarn add date-in-utc
    

    Usage

    const dateInUtc = require('date-in-utc');
     
    dateInUtc(0, new Date('2018-4-25 18:30')).toLocaleString();
    //=> '2018-4-25 12:30:00'
     
    dateInUtc(5.5, new Date('2018-4-25 18:30')).toLocaleString();
    //=> '2018-4-25 18:00:00'
     
    dateInUtc(-12, new Date('2018-4-25 18:30')).toLocaleString();
    //=> '2018-4-25 00:30:00'

    API

    dateInUtc(utcOffset, date)

    License

    MIT © Joynal Abedin

    Install

    npm i date-in-utc

    DownloadsWeekly Downloads

    0

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    43.6 kB

    Total Files

    9

    Last publish

    Collaborators

    • joynal