{"id":18609,"library":"node-red-contrib-moment","title":"node-red-contrib-moment","description":"Node-RED node for date/time formatting using Moment.js, with timezone, DST, and locale support. Current stable version is 5.0.0, requiring Node.js >=14.14 and Node-RED >=1.0. Provides two nodes: 'moment' for date/time formatting and 'humanizer' for duration descriptions. Locale-aware output strings. Note that moment.js is now built into JSONata, making this package less necessary; no further enhancements expected. Release cadence is irregular, with major versions introducing breaking dependency updates.","status":"maintenance","version":"5.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/totallyinformation/node-red-contrib-moment","tags":["javascript","node-red","moment","momentjs","time","date","timezone","locale","DST"],"install":[{"cmd":"npm install node-red-contrib-moment","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-moment","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-moment","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core date/time manipulation library used by the nodes","package":"moment","optional":false}],"imports":[{"note":"The package registers nodes with Node-RED at installation time. No manual import is needed.","wrong":"Attempting to import or require the package directly (e.g., const momentNode = require('node-red-contrib-moment')) is incorrect.","symbol":"node-red-contrib-moment","correct":"Package is installed as a Node-RED node; no explicit import in code."}],"quickstart":{"code":"// No code import; install via Node-RED palette or run:\n// cd ~/.node-red && npm install node-red-contrib-moment\n// Then use the 'moment' node in your flows:\n// 1. Inject a timestamp (or msg with a payload convertible to date)\n// 2. Connect to moment node\n// 3. Configure output format (e.g., \"MMMM Do YYYY, h:mm:ss a\")\n// 4. Connect to debug node to see formatted string","lang":"javascript","description":"Installation and basic usage of the moment node in Node-RED: inject timestamp, configure format, output."},"warnings":[{"fix":"Upgrade Node.js to >=10 and Node-RED to >=1.0 before installing v4+.","message":"Node.js minimum version raised to v10 and Node-RED minimum to v1.0 in v4.0.0.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Consider using Node-RED's built-in JSONata moment functions in Change or Function nodes instead.","message":"Package is unlikely to receive further enhancements; moment.js is built into JSONata.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Always verify month values: January is 0, December is 11.","message":"Moment.js treats months as zero-based (0 = January) when parsing object formats.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure input is a ISO 8601 string, Unix timestamp (milliseconds), or Date object.","message":"If msg.payload is not a valid date string or timestamp, the node may output 'Invalid date'.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install node-red-contrib-moment' from your Node-RED userDir (typically ~/.node-red).","cause":"Package not installed or installed in wrong directory.","error":"Error: Cannot find module 'node-red-contrib-moment'"},{"fix":"Do not require the package; use the node in your flows.","cause":"Attempting to use moment() directly from the package, which exports Node-RED nodes not a moment function.","error":"TypeError: moment is not a function"},{"fix":"Ensure Node.js version matches the one used during npm install. Try reinstalling: rm -rf node_modules && npm install.","cause":"Node.js version mismatch with native addon (though this package has none, but arises with native deps).","error":"Error: Module version mismatch. Expected 83, got 84."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}