# Trigger timestamp output

**URL:** https://discourse.nodered.org/t/trigger-timestamp-output/36586
**Category:** General
**Created:** [26 November 2020 20:39 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586 "2020-11-26T20:39:32Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![brainbugfix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/brainbugfix/32/34396_2.png) [@brainbugfix](https://discourse.nodered.org/u/brainbugfix)
#### Post date: [26 November 2020 20:39 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/1 "2020-11-26T20:39:32Z")

</div>

Hi,

is it by intention that the trigger node when configured to send a timestamp when it is triggered and also when the time is over, the time is the same? Since the trigger can be reset, this does not make much sense, does it?

Thanks,  
Markus

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [26 November 2020 21:38 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/2 "2020-11-26T21:38:59Z")

</div>

I agree it does seem a little strange that the timestamp sent in the second message is the same as that of the first, one might expect it to be the current time in each case.

@knolleary @dceejay do you think this is a bug or a feature?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [26 November 2020 22:59 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/3 "2020-11-26T22:59:39Z")

</div>

yes - the incoming message is just cloned and then resent... so yes is a little odd - It is probably is a bug - but needs thinking about. Would anyone be relying on the existing behaviour ?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [27 November 2020 08:02 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/4 "2020-11-27T08:02:38Z")

</div>

It seems unlikely, but impossible to know, unless it happens to be someone here. Difficult to know what is for the best.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [27 November 2020 08:09 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/5 "2020-11-27T08:09:23Z")

</div>

> [@dceejay](#):
>
> Would anyone be relying on the existing behaviour

I agree with Colin, "unlikely" but you never know!?!?

There are a few possible workarounds that come to mind...

- major version update & replace the timestamp with `Date.now()`?  
or
- An backwards compatible additional option `[x] Send current time` ?  
or
- An a additional `.now` timestamp in the `msg`?  
or
- Leave it as is and have folk use a change/function node afterwards?

any favourites / other ideas?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [27 November 2020 09:05 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/6 "2020-11-27T09:05:54Z")

</div>

- It's a core node so a major bump would have to wait for Node-RED v2 🙂
- having two options that say timestamp would look daft...
- possible but again uugh
- possible - but...

I think I'm falling on the side of "it's a bug" as the intention was for it to be the latest timestamp (especially if you set it to be a repeating (first) output.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [27 November 2020 10:08 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/7 "2020-11-27T10:08:00Z")

</div>

> [@Steve-Mcl](#):
>
> major version update

That depends on whether one considers it a bug. If it is a bug then there is no need for a major version upgrade. Personally I would class it as a bug, and the OP here apparently expected the logical behaviour, not as it is at the moment. I suspect no-one has ever used the node in this way so it has not been noticed.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [27 November 2020 10:24 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/8 "2020-11-27T10:24:43Z")

</div>

fell free to raise an issue so we can track it properly. Thanks

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [29 November 2020 10:40 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/9 "2020-11-29T10:40:32Z")

</div>

I was just off to add an issue, but I see @brainbugfix has beaten me to it.

> <https://github.com/node-red/node-red/issues/2771>
>
> What are the steps to reproduce?
> Set actions on activate and deactivate to "Timestamp"
> Activate the trigger node
> Let it expire
> What happens?
> The output is...

---

<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: [28 January 2021 10:40 UTC](https://discourse.nodered.org/t/trigger-timestamp-output/36586/10 "2021-01-28T10:40:40Z")

</div>

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