# Timestamp in GraphQL query

**URL:** https://connective.celigo.com/t/timestamp-in-graphql-query/4641
**Category:** Integrator.io
**Created:** [May 23, 2025, 9:38am UTC](https://connective.celigo.com/t/timestamp-in-graphql-query/4641 "2025-05-23T09:38:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Matthew\_Lacey](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Matthew\_Lacey](https://connective.celigo.com/u/Matthew_Lacey)
#### Post date: [May 23, 2025, 9:38am UTC](https://connective.celigo.com/t/timestamp-in-graphql-query/4641/1 "2025-05-23T09:38:30Z")

</div>

Hello! I'd appreciate some help with a GraphQL query I have on a custom Shopify flow.  
The query is cobbled together from various sources that I found, as I'm not very confident/knowledgeable in writing such things from scratch.

Currently this part returns items that were modified at any point since 00.01 on todays date;

updated\_at:\>='{{{dateFormat "YYYY-MM-DD[T00:00:01Z]" timeStamp}}}

How could I modify this so that it only return items modified within the last hour? I know this is probably a simple thing to do, but I'm struggling to get started.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![craigscott](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/craigscott/32/7253_2.png) [@craigscott](https://connective.celigo.com/u/craigscott)
#### Post date: [May 23, 2025, 1:31pm UTC](https://connective.celigo.com/t/timestamp-in-graphql-query/4641/2 "2025-05-23T13:31:04Z")

</div>

Are you writing this write in a graphql query field or as part of a script where you can set variables? The easiest way to do it, if it's running in a script somewhere, is the convert the present time to miliseconds, subtract the miliseconds of your time period (hour, day, whatever), then take that result and covert it back to UTC. Then you have the variable you need and insert it into the query.

Where in your flow are your running this? Could you post screenshots? Might be able to give more direct solutions then.

Also this might be helpful depending on where you are writing the query, but you can create time stamps in handlebars

[https://docs.celigo.com/hc/en-us/articles/360039326071-Handlebars-helper-reference#custom-helpers-1:~:text=110-,timestamp,-Returns%20a%20timestamp](https://docs.celigo.com/hc/en-us/articles/360039326071-Handlebars-helper-reference#custom-helpers-1:~:text=110-,timestamp,-Returns%20a%20timestamp)

---

<div class="post-metadata">

### Author: ![Matthew\_Lacey](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Matthew\_Lacey](https://connective.celigo.com/u/Matthew_Lacey)
#### Post date: [May 23, 2025, 1:38pm UTC](https://connective.celigo.com/t/timestamp-in-graphql-query/4641/3 "2025-05-23T13:38:28Z")

</div>

Hi Craig, thanks for your reply. The query is written in the HTTP request body part of the export step in my flow.

I think a handlebar expression might be the best thing for me to try, as I could effectively experiment outside of the flow until I get the desired result. I'm wondering if I can just use {{timestamp}} - _milliseconds equivalent of an hour_  
or  
{{timestamp - _milliseconds equivalent of an hour_}}

I'll have a play around anyway.

Thanks!

---

<div class="post-metadata">

### Author: ![Matthew\_Lacey](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Matthew\_Lacey](https://connective.celigo.com/u/Matthew_Lacey)
#### Post date: [May 23, 2025, 1:50pm UTC](https://connective.celigo.com/t/timestamp-in-graphql-query/4641/4 "2025-05-23T13:50:12Z")

</div>

I think I'm getting somewhere with this now;

{{dateAdd timestamp -3600000}}

Seems to give me the correct result, so I just need to figure out how to insert that into the query correctly.

---

<div class="post-metadata">

### Author: ![Matthew\_Lacey](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Matthew\_Lacey](https://connective.celigo.com/u/Matthew_Lacey)
#### Post date: [May 28, 2025, 9:21am UTC](https://connective.celigo.com/t/timestamp-in-graphql-query/4641/5 "2025-05-28T09:21:40Z")

</div>

In case it is useful for anybody else in the future, the exact syntax needed for the handlebar expression in the query (or at least the one that worked for me) was;

{{dateAdd (dateFormat "YYYY-MM-DDTHH:mm:ssZ" timestamp) -3600000}}
