# toTime function not working across browsers

**URL:** <https://community.weweb.io/t/totime-function-not-working-across-browsers/1439>\
**Category:** Ask us anything\
**Created:** [November 15, 2022, 6:11am UTC](https://community.weweb.io/t/totime-function-not-working-across-browsers/1439 "2022-11-15T06:11:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![forgelab](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/forgelab/32/9671_2.png) [@forgelab](https://community.weweb.io/u/forgelab)\
**Post date:** [November 15, 2022, 6:11am UTC](https://community.weweb.io/t/totime-function-not-working-across-browsers/1439/1 "2022-11-15T06:11:25Z")

</div>

Hi WW community and team,

I’m using the toTime formula and, while it appears to work in Chrome on the desktop I’m developing, on Safari (desktop & mobile) and Chrome mobile, the timestamp is showing `NaN years ago`.

**Test #1 shows that the data is being returned by backend when run on Chrome (left) and Safari (right):**

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/d94a3b14ad45a6bb3373ed50649fb44bb97c9a94.png)

**Test #2 shows that when the formula is added, it works on Chrome, but not Safari:**  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/a10687ebb91fd98677dd43bcc704f4c77c2d21f5.png)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/9/9b1bb535e27d63588457a66905fd73cdd999969a.jpeg)

Is there a configuration I’m missing? Thanks!

---

<div class="post-metadata">

**Author:** ![dorilama](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorilama/32/10403_2.png) [@dorilama](https://community.weweb.io/u/dorilama)\
**Post date:** [November 15, 2022, 11:15am UTC](https://community.weweb.io/t/totime-function-not-working-across-browsers/1439/2 "2022-11-15T11:15:37Z")

</div>

Can you try some other string as input and see if they are working correctly:

- `2022-11-11 17:01:50.575678+00:00`
- `2022-11-11 17:01:50.575678+0000`
- `2022/11/11 17:01:50.575678+00`  
It may be related with a bug in safari

for [@weweb-team](https://community.weweb.io/groups/weweb-team) maybe is related to this [safari cannot format "2022-09-11 00:00:00 +0800" · Issue #1822 · iamkun/dayjs · GitHub](https://github.com/iamkun/dayjs/issues/1822)

---

<div class="post-metadata">

**Author:** ![forgelab](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/forgelab/32/9671_2.png) [@forgelab](https://community.weweb.io/u/forgelab)\
**Post date:** [November 15, 2022, 5:58pm UTC](https://community.weweb.io/t/totime-function-not-working-across-browsers/1439/3 "2022-11-15T17:58:26Z")

</div>

@dorilama thank you very much for your feedback and guidance.

after looking into this further, we identified the root issue and put in the below fix.

our GraphQL response was the following:  
`"createdAt": "2022-11-11 17:44:34.934629+00",`

but we expected this:  
`"createdAt": "2022-11-11T17:44:34.934Z",`

the fix using javascript to remove the space before feeding into toTime formula:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/7f5c5bf120498c028ff31dbe5c98d856d472a5d3.png)

and all fixed on Safari:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/863c04eb917af093a8a8cb0e31a0d90d361b8a46.png)

thank you again. hope the above helps anyone else who encounters this issue.
