# Inject node with date

**URL:** <https://discourse.nodered.org/t/inject-node-with-date/60858>\
**Category:** General\
**Created:** [6 April 2022 04:55 UTC](https://discourse.nodered.org/t/inject-node-with-date/60858 "2022-04-06T04:55:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pool](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@pool](https://discourse.nodered.org/u/pool)\
**Post date:** [6 April 2022 04:55 UTC](https://discourse.nodered.org/t/inject-node-with-date/60858/1 "2022-04-06T04:55:22Z")

</div>

I am using a nordpool api to read the prices from Nordpool.

The readme tells **"Its also possible to inject a `msg.date` to get price from a specific date"**

How?  
msg.payload.date then date? I think I need the date in ms like the timestamp?

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [6 April 2022 05:35 UTC](https://discourse.nodered.org/t/inject-node-with-date/60858/2 "2022-04-06T05:35:24Z")

</div>

It s up to you, what you prefer:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/db50846c117dd78568764cc9337ceeadbc1f0135.png)

```auto
[
    {
        "id": "0b9dd5d53b447269",
        "type": "debug",
        "z": "7fd8fff652f013f7",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "date",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 900,
        "y": 3400,
        "wires": []
    },
    {
        "id": "ec50e20e82aabaec",
        "type": "inject",
        "z": "7fd8fff652f013f7",
        "name": "msg.date as timestamp",
        "props": [
            {
                "p": "date",
                "v": "",
                "vt": "date"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 640,
        "y": 3360,
        "wires": [
            [
                "0b9dd5d53b447269"
            ]
        ]
    },
    {
        "id": "fb0df6da97e9ef03",
        "type": "inject",
        "z": "7fd8fff652f013f7",
        "name": "msg.date as date string",
        "props": [
            {
                "p": "date",
                "v": "$moment()",
                "vt": "jsonata"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 640,
        "y": 3420,
        "wires": [
            [
                "0b9dd5d53b447269"
            ]
        ]
    }
]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 June 2022 05:36 UTC](https://discourse.nodered.org/t/inject-node-with-date/60858/3 "2022-06-05T05:36:08Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
