Moment.js is freely available for download from the project’s home page. moment().from (Moment|String|Number|Date|Array); moment().to(Moment|String| Moment.js datetime arithmetic The add () function is used to add date and time to the moment object and the subtract () function subtract date and time from the moment object. let startOfDay = now.clone().startOf(‘day’) // set this date to 12:00am today Quite popular in the community, it gets frequent updates and has detailed documentation on how to use it. Moment.js unix time. Moment.js is a javascript that processes and displays date and time. Embed. Moment Timezone. IANA Time zone support for Moment.js. I'm using datetimepicker.js and its date function returns a moment.js object. let nowNz =,"Pacific/Auckland"); // Tell moment that this date is a NZ date. Moment Timezone. Best thing to do is browse through the docs and see if Moment can help. Note: I will mostly be talking about Node.JS related code in this blog, but Moment.js works exactly the same in browsers and other javascript engines. In this post we will give you information about How to get local time from UTC using Moment.JS with example. Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor. Responsive table using "display: flex;". moment-timezone-with-data-10-year-range.js moment-timezone-with-data-10-year-range.min.js 11.6k moment-timezone-with-data-1970-2030.js moment-timezone-with-data-1970-2030.min.js 19.8k moment-timezone-with-data.js moment-timezone-with-data.min.js 28.8k moment-timezone.js (no data) moment-timezone.min.js 2.9k By default, moment objects are created in the local time zone. Moment is a well established JavaScript … moment(1318874398806).valueOf(); // 1318874398806 let startOfMonth = moment().startOf(‘month’); // set to first of this month 12:00am Changing the value of moment.defaultFormat will only affect formatting, and will not affect parsing. [code language=”javascript”] The best medicine for these headaches (as many of you know already) is Moment.js However, Moment was built for the previous era of the JavaScript ecosystem. I have a datepicker which returns local time in the format dddd, MMMM DO YYYY, h:mm:ss a to a variable localTime.I have an option to change the timezone from a