{"id":13800324,"url":"https://github.com/Paul-Reed/node-red-contrib-simpletime","last_synced_at":"2025-05-13T09:31:31.504Z","repository":{"id":44663802,"uuid":"110151230","full_name":"Paul-Reed/node-red-contrib-simpletime","owner":"Paul-Reed","description":"A lightweight node-red node to provide and format date and time.","archived":false,"fork":false,"pushed_at":"2024-09-08T18:10:46.000Z","size":71,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T21:27:05.041Z","etag":null,"topics":["node-red","npm-package","timestamp"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Paul-Reed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-09T18:25:12.000Z","updated_at":"2024-09-25T08:01:39.000Z","dependencies_parsed_at":"2024-05-11T18:28:30.736Z","dependency_job_id":"94035b81-5daa-479d-b86a-cce72de40a1d","html_url":"https://github.com/Paul-Reed/node-red-contrib-simpletime","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.016949152542372836","last_synced_commit":"c7da711e8d8d28661abe74e50d1bc5ca1f273ee5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paul-Reed%2Fnode-red-contrib-simpletime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paul-Reed%2Fnode-red-contrib-simpletime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paul-Reed%2Fnode-red-contrib-simpletime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paul-Reed%2Fnode-red-contrib-simpletime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Paul-Reed","download_url":"https://codeload.github.com/Paul-Reed/node-red-contrib-simpletime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253913109,"owners_count":21983259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["node-red","npm-package","timestamp"],"created_at":"2024-08-04T00:01:11.459Z","updated_at":"2025-05-13T09:31:30.451Z","avatar_url":"https://github.com/Paul-Reed.png","language":"HTML","readme":"node-red-contrib-simpletime\n====================\n[![NPM version][npm-version-image]][npm-url]\n[![NPM downloads per month][npm-downloads-month-image]][npm-url]\n[![NPM downloads total][npm-downloads-total-image]][npm-url]\n[![MIT License][license-image]][license-url]\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nA \u003ca href=\"http://nodered.org\" target=\"_new\"\u003eNode-RED\u003c/a\u003e node that is extremely lightweight and which can be inserted in any running flow, and adds time and date payloads with various formatting options, which can be retreived and used later in the flow.  \nIt can also accept an input of a date (see inputs below), and use that date to calculate simpletime's outputs.\n\nInstall\n-------\n\nRun the following command in your Node-RED user directory - typically `~/.node-red`\n\n    npm install node-red-contrib-simpletime\n\n\nUsage\n-----\n\n\n### Inputs\n\nAny existing payloads or topics being injected into simpletime will pass unaltered through the node except msg.date  \nIf msg.date is present, it MUST contain a valid date that could be processed by the `new Date()` constructor such as;  \n`2024-04-16T12:02:05Z`  \n`Mon, 22 Apr 2024 19:55:05 GMT`  \n`2024-05-11`  \n`1715538484102` (as a number)\n\nIf msg.date is not present, simpletime will calculate it's outputs based on the current date \u0026 time.\n\n### Outputs\n\nIn addition to any existing payloads, a number of additional payloads will be added, which can be utilised later in the flow.  \nBy default, all the additional properties will be added to the message but this can be altered in the node configuration, using checkboxes\n\n### Details\n\nThe additional payloads added to the flow, and their typical content format are;\n\n* msg.mydate: \"Tue Sep 11 2018\"\n* msg.myymd: \"2018-09-11\"\n* msg.myyear: \"2018\"\n* msg.mymonth: \"Sep\"\n* msg.mymonthf: \"September\"\n* msg.mymonthn: \"09\"\n* msg.mydom: \"11\"\n* msg.mydoy: \"86\"\n* msg.myday: \"Tue\"\n* msg.mydayf: \"Tuesday\"\n* msg.myhourpm: \"7\"\n* msg.myhour: \"19\"\n* msg.mytime: \"19:51\"\n* msg.mytimes: \"19:51:17\"\n* msg.myminute: \"51\"\n* msg.myminutes: \"51:17\"\n* msg.mysecond: \"17\"\n* msg.mymillis: \"985\"\n* msg.myepoch: \"1536691877064\"\n* msg.myrawdate: \"2018-09-11T18:51:17.064Z\"\n* msg.mypm: \"PM\"\n\nTo introduce any of the messages into a flow, simply assign any, or any combination of the messages into a variable, such as; \u003ccode\u003evar seconds = msg.myseconds;\u003c/code\u003e or to use in a ui_text node add via mustache \u003ccode\u003e{{mytimes}}\u003c/code\u003e  \nMore advanced date formats can also be constructed, such as \u003ccode\u003e{{mytime}}hrs - {{mydom}}/{{mymonth}}\u003c/code\u003e to get \"20:10hrs - 11/Sep\", or \u003ccode\u003e{{myhourpm}}:{{myminute}}{{mypm}}\u003c/code\u003e to get \"8.10PM\"\n\nFor more advanced timezone handling, \u003ccode\u003enode-red-contrib-moment\u003c/code\u003e is recommended.\n\n[license-image]: https://img.shields.io/badge/license-Apache%202-blue\n[license-url]: https://github.com/Paul-Reed/node-red-contrib-simpletime/blob/master/LICENSE\n[npm-url]: https://www.npmjs.com/package/node-red-contrib-simpletime\n[npm-version-image]: https://img.shields.io/npm/v/node-red-contrib-simpletime.svg\n[npm-downloads-month-image]: https://img.shields.io/npm/dm/node-red-contrib-simpletime.svg\n[npm-downloads-total-image]: https://img.shields.io/npm/dt/node-red-contrib-simpletime.svg\n","funding_links":[],"categories":["Nodes"],"sub_categories":["Time"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPaul-Reed%2Fnode-red-contrib-simpletime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPaul-Reed%2Fnode-red-contrib-simpletime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPaul-Reed%2Fnode-red-contrib-simpletime/lists"}