Registry / workflow / node-red-contrib-simpletime

node-red-contrib-simpletime

JSON →
library3.1.0jsnpmunverified

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.

npm install node-red-contrib-simpletime
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-S
N
node-red-contrib-simpletime
workflowjavascriptv3.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

simpletime
npm install node-red-contrib-simpletime
import { simpletime } from 'node-red-contrib-simpletime'
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.
msg.mytime
const currentTime = msg.mytime;
import { mytime } from 'node-red-contrib-simpletime'
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.
msg.date (input)
msg.date = new Date().toISOString(); return msg;
import { date as SimpleTimeInput } from 'node-red-contrib-simpletime'
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.

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.

npm install node-red-contrib-simpletime // Conceptual Node-RED Flow: // 1. Drag an 'Inject' node onto the canvas. // 2. Drag a 'simpletime' node (from the palette) onto the canvas. // 3. Drag a 'Debug' node onto the canvas. // 4. Connect 'Inject' -> 'simpletime' -> 'Debug'. // 5. Configure the 'simpletime' node (e.g., enable all outputs). // 6. Deploy the flow and click the 'Inject' node to see time outputs in the debug sidebar.
Debug
Known issues
gotchaThe `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.
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`).
affects: >=1.0.0
gotchaThis 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.
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`.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'node-red-contrib-simpletime'
Attempting to `require()` or `import` the package as a standard npm library module in a JavaScript file outside of the Node-RED runtime environment.
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.
Node does not appear in the palette after installation.
Node-RED was not restarted after package installation, or the package was installed into an incorrect directory.
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.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
node-red-contrib-simpletime — npm install node-red-contrib-simpletime · libregistry