{"id":13650,"library":"node-red-contrib-simpletime","title":"Node-RED Simple Time Node","description":"node-red-contrib-simpletime is a lightweight Node-RED node designed to inject and format date and time information into message payloads. Its current stable version is 3.1.0, and based on its npm activity and badge presence, it appears to maintain a regular update cadence. The node provides various pre-formatted date and time properties (e.g., `msg.myymd`, `msg.mytime`, `msg.myepoch`) that can be easily accessed in subsequent flow nodes like function nodes or UI templates. A key differentiator is its minimal footprint and simplicity for common date/time tasks, contrasting with more robust but heavier alternatives like `node-red-contrib-moment` for advanced timezone handling. It can operate on the current system time or process a provided `msg.date` input.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/Paul-Reed/node-red-contrib-simpletime","tags":["javascript","node-red","time","date","moment"],"install":[{"cmd":"npm install node-red-contrib-simpletime","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-simpletime","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-simpletime","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package provides a Node-RED node, which is installed via the command line into the Node-RED user directory (typically `~/.node-red`). It does not export JavaScript symbols for direct programmatic import into external scripts. After installation, the 'simpletime' node becomes available in the Node-RED editor palette.","wrong":"import { simpletime } from 'node-red-contrib-simpletime'","symbol":"simpletime","correct":"npm install node-red-contrib-simpletime"},{"note":"The `simpletime` node adds various formatted date and time properties directly to the incoming message object (e.g., `msg.mytime`, `msg.mydate`, `msg.myepoch`). These properties are then accessed directly on the `msg` object within subsequent Node-RED function nodes, change nodes, or UI template nodes. They are not module exports.","wrong":"import { mytime } from 'node-red-contrib-simpletime'","symbol":"msg.mytime","correct":"const currentTime = msg.mytime;"},{"note":"The `simpletime` node can accept an optional `msg.date` property as input. If present, it must contain a valid date string or numeric Unix timestamp that can be parsed by the JavaScript `new Date()` constructor. The node will then use this input date for its calculations instead of the current system time.","wrong":"import { date as SimpleTimeInput } from 'node-red-contrib-simpletime'","symbol":"msg.date (input)","correct":"msg.date = new Date().toISOString(); return msg;"}],"quickstart":{"code":"npm install node-red-contrib-simpletime\n\n// Conceptual Node-RED Flow:\n// 1. Drag an 'Inject' node onto the canvas.\n// 2. Drag a 'simpletime' node (from the palette) onto the canvas.\n// 3. Drag a 'Debug' node onto the canvas.\n// 4. Connect 'Inject' -> 'simpletime' -> 'Debug'.\n// 5. Configure the 'simpletime' node (e.g., enable all outputs).\n// 6. Deploy the flow and click the 'Inject' node to see time outputs in the debug sidebar.","lang":"javascript","description":"Installs the node-red-contrib-simpletime package into your Node-RED environment and outlines a basic flow to demonstrate its functionality by injecting a message and observing the added time/date properties in the debug sidebar."},"warnings":[{"fix":"Ensure `msg.date` is formatted as a valid ISO 8601 string (e.g., `2024-04-16T12:02:05Z`), a GMT string (e.g., `Mon, 22 Apr 2024 19:55:05 GMT`), a YYYY-MM-DD string, or a numeric Unix timestamp (e.g., `1715538484102`).","message":"The `msg.date` input property must contain a valid date string or number parsable by `new Date()`. Providing an invalid format will cause the node to revert to using the current date and time for its outputs without explicit error feedback.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For advanced timezone requirements or date calculations, install and utilize `node-red-contrib-moment` either in conjunction with or as an alternative to `node-red-contrib-simpletime`.","message":"This node does not provide advanced timezone handling or complex date arithmetic beyond standard system time. For specific timezone conversions, daylight saving adjustments, or intricate date manipulations, `node-red-contrib-moment` is recommended.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'3.1.0':36 'access':73 'activ':42 'advanc':111 'altern':103 'appear':47 'badg':44 'base':38 'cadenc':53 'common':94 'contrast':97 'contrib':10,108 'current':32,119 'date':24,61,133 'date/time':95 'design':19 'differenti':86 'e.g':65 'easili':72 'flow':76 'footprint':90 'format':23,60 'function':79 'handl':113 'heavier':102 'inform':27 'inject':21 'input':127 'javascript':128 'key':85 'lightweight':14 'like':78,104 'maintain':49 'messag':29 'minim':89 'moment':109,134 'msg.date':126 'msg.myepoch':68 'msg.mytime':67 'msg.myymd':66 'node':2,6,8,16,18,55,77,80,106,130 'node-r':1,15,129 'node-red-contrib-mo':105 'node-red-contrib-simpletim':7 'npm':41 'oper':116 'payload':30 'pre':59 'pre-format':58 'presenc':45 'process':123 'properti':64 'provid':56,125 'red':3,9,17,107,131 'regular':51 'robust':100 'simpl':4 'simpletim':11 'simplic':92 'stabl':33 'subsequ':75 'system':120 'task':96 'templat':83 'time':5,26,63,121,132 'timezon':112 'ui':82 'updat':52 'various':57 'version':34","created_at":"2026-04-20T01:55:35.712566+00:00","updated_at":"2026-04-20T01:55:35.712566+00:00","problems":[{"fix":"This package is a Node-RED node. It must be installed into your Node-RED user directory (typically `~/.node-red`) via `npm install node-red-contrib-simpletime` and subsequently used within the Node-RED flow editor, not directly referenced in JavaScript code.","cause":"Attempting to `require()` or `import` the package as a standard npm library module in a JavaScript file outside of the Node-RED runtime environment.","error":"Cannot find module 'node-red-contrib-simpletime'"},{"fix":"Ensure you installed the package in your Node-RED user directory (often `~/.node-red`). After installation, you must restart your Node-RED instance for new nodes to be loaded and appear in the palette.","cause":"Node-RED was not restarted after package installation, or the package was installed into an incorrect directory.","error":"Node does not appear in the palette after installation."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Paul-Reed/node-red-contrib-simpletime","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/node-red-contrib-simpletime","openapi_spec":null,"status_page":null,"smithery":null,"categories":["workflow","data","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}