Answers for "moment(...).tz is not a function"

0

moment(...).tz is not a function

If you're using Node.js, you may accidentally be using

const moment = require('moment'); //moment

instead of

const moment = require('moment-timezone'); //moment-timezone

Also, make sure you have installed moment-timezone with

npm install moment-timezone --save

Explanation
The bug of requiring moment without timezones could occur by installing moment
with require('moment'), later deciding to npm install moment-timezone, and then
forgetting to update the require.
Posted by: Guest on September-17-2021

Code answers related to "moment(...).tz is not a function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language