# Missing date shift in {{formatDate val formatStr}} before formattting?

**URL:** <https://forums.losant.com/t/missing-date-shift-in-formatdate-val-formatstr-before-formattting/5381>\
**Category:** Help\
**Tags:** handlebars, templates\
**Created:** [January 4, 2024, 4:49pm UTC](https://forums.losant.com/t/missing-date-shift-in-formatdate-val-formatstr-before-formattting/5381 "2024-01-04T16:49:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emcdee](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/emcdee/32/4313_2.png) [@emcdee](https://forums.losant.com/u/emcdee)\
**Post date:** [January 4, 2024, 4:49pm UTC](https://forums.losant.com/t/missing-date-shift-in-formatdate-val-formatstr-before-formattting/5381/1 "2024-01-04T16:49:14Z")

</div>

Unless I missed in ‘accessing payload data’, how do you shift a currentDateTime like in subject expression _before_ the momentjs formatStr? That too inclusive of DST for a given US timezone.

Ex, I’d imagine you want formatStr to be something like - `'ddd MMM D, YYYY HH:mm:ss.SSS [GMT]-05:00'`  
To get the native format that’s on the Payload -  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/635d9a4549dbc8ffa02f3beb4d444f040c414ae0.png)

With the full expression being -

```auto
{{currentDateTime 'ddd MMM D, YYYY HH:mm:ss.SSS [GMT]-05:00'}}

```

However this returns GMT (doesn’t shift to EST), which is confusing because the formatStr puts the “-05:00” stamp on it…

Beyond that, is there more documentation on `{{formatDateRelative date relativeTo}}`, such as being able to use currentDateTime and options like “5 hours ago”?

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [January 4, 2024, 9:40pm UTC](https://forums.losant.com/t/missing-date-shift-in-formatdate-val-formatstr-before-formattting/5381/2 "2024-01-04T21:40:13Z")

</div>

The `{{currentDateTime}}` and `{{formatDate}}` helpers do not support providing a timezone offset; we have an open feature request for that and I will add your +1 to the request.

The underlying value on the payload is actually a [JavaScript `Date` object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date); the format you are seeing in the payload preview is the result of the [`toString()` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) being applied to the object client-side (in your browser). For example, if you ran the following in a Function Node …

```js
console.log(payload.time.toString());

```

… the output would include no offset, because the operation is happening on Losant’s servers outside the context of a timezone:

> Thu Jan 04 2024 21:32:25 GMT+0000 (Coordinated Universal Time)

One thing you could do, in a workflow, is use the [Date/Time Node](https://docs.losant.com/workflows/logic/date-time/) to get the result you are looking for.

 ![Screenshot 2024-01-04 at 4.39.56 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/b/b642127549b0ed5f3eb76dc25f2a6a64d55a445f.png)

Format string used here: `ddd MMM D, YYYY HH:mm:ss.SSS [GMT]Z`
