# How to get the timestamp for use in an expression item

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-the-timestamp-for-use-in-an-expression-item/5066>\
**Category:** Ignition\
**Created:** [August 27, 2012, 11:54pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-timestamp-for-use-in-an-expression-item/5066 "2012-08-27T23:54:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![miketob](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/miketob/32/5936_2.png) [@miketob](https://forum.inductiveautomation.com/u/miketob)\
**Post date:** [August 27, 2012, 11:54pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-timestamp-for-use-in-an-expression-item/5066/1 "2012-08-27T23:54:18Z")

</div>

Hello,

I’m trying to setup a standard transaction group to run every hour, but I need it to run every exact hour (0 minutes, and 0 seconds)so I’m using the Schedule option like this: 00:00,1:00,…,23:00

There is one field (named Status) in my database that I want to fill with a ‘1’ only at certain hours, say 5:00 and 8:00, but I want to store a ‘0’ for all other hours

I was thinking about using an expression item to get the hour from the timestamp like this:

Expression:  
dateExtract(TransactionTimeStamp(),“hour”)=5  
|| dateExtract(TransactionTimeStamp(),“hour”)=8

But I don’t know how to get the timestamp of the transaction.  
I guess the “now()” function could help, but I think it is not exactly the same as the timestamp

Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [August 27, 2012, 11:56pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-timestamp-for-use-in-an-expression-item/5066/2 "2012-08-27T23:56:42Z")

</div>

The now() function in a Triggered Expression item will return the current time for when the expression ran (ie: when the group is triggered). Did you want a different timestamp than that?

---

<div class="post-metadata">

**Author:** ![miketob](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/miketob/32/5936_2.png) [@miketob](https://forum.inductiveautomation.com/u/miketob)\
**Post date:** [August 28, 2012, 12:31am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-timestamp-for-use-in-an-expression-item/5066/3 "2012-08-28T00:31:44Z")

</div>

Hi Robert,

Thanks for your reply  
No, I dont need another time stamp, then “Now()” is just what I need.

I thought that Now() returned the timestamp of the moment of evaluation of the function “now” itself.  
But if it returns the timestamp of the trigger is just exactly what I need.

Thank you very much.
