# Need help with time function

**URL:** <https://discourse.nodered.org/t/need-help-with-time-function/85368>\
**Category:** General\
**Created:** [9 February 2024 14:03 UTC](https://discourse.nodered.org/t/need-help-with-time-function/85368 "2024-02-09T14:03:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin2day](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@martin2day](https://discourse.nodered.org/u/martin2day)\
**Post date:** [9 February 2024 14:03 UTC](https://discourse.nodered.org/t/need-help-with-time-function/85368/1 "2024-02-09T14:03:42Z")

</div>

Hello,

i want to use node Red to optimize my PV System, my battery charger and my heat pump.  
For this i have read an function that use the solar forecast of the day and calculate the optimal time where i have to switch my heat pump on and off.  
The function give my two times:  
bestStartTime  
bestEndTime

But now i did not know the how i must do the last step 🙂  
I can show this two values.. now problem, but if i read out  
`bestStartTime: "2024-02-09T10:30:00.000Z"`  
I will send an MQTT Message at 10:30 to my HeatPump to turn it on.

How can i read out this bestStartTime and send a message at this time?

Thank you very much  
Have a nice day  
Martin

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [9 February 2024 14:08 UTC](https://discourse.nodered.org/t/need-help-with-time-function/85368/2 "2024-02-09T14:08:09Z")

</div>

You probably want to use a scheduling node like [node-red-contrib-cron-plus (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-cron-plus)

---

<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:** [9 May 2024 14:09 UTC](https://discourse.nodered.org/t/need-help-with-time-function/85368/3 "2024-05-09T14:09:09Z")

</div>

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