utc-local

This package is used to convert utc time to local by passing time zone.Accuracy is built on calculations not depend on offset.

Usage no npm install needed!

<script type="module">
  import utcLocal from 'https://cdn.skypack.dev/utc-local';
</script>

README

UTC to local date and time

This api is build to convert UTC date and time to local date and time by passing UTC date time and correct timezone

Getting Started

Simply install package with

  npm i utc-local
 
 const utcLocal = require("utc-local")

 const date =  utcLocal.getLocal("2019-11-14 07:39:12", "Asia/Kolkata")

 console.log(date)
 
 const diff = utcLocal.fromNow("2019-11-14 07:39:12", "Asia/Kolkata")

 console.log(diff)

"2019-11-14 13:09:12" //(Local time by time zone Asia/Kolkata)