# toText(Date) wrong timezone?

**URL:** <https://community.fibery.io/t/totext-date-wrong-timezone/1441>\
**Category:** Bugs & Issues\
**Created:** [March 11, 2021, 1:31pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441 "2021-03-11T13:31:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreasHe\_daic](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@AndreasHe\_daic](https://community.fibery.io/u/AndreasHe_daic)\
**Post date:** [March 11, 2021, 1:31pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/1 "2021-03-11T13:31:41Z")

</div>

Using toText(Date) and Date has a time. e.g. 15:00 oclock set.

But it displays 14:00 oclock after toText(). Maybe wrong timezone?

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [March 13, 2021, 8:14pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/2 "2021-03-13T20:14:48Z")

</div>

Hi!  
Yes, our bug. We don’t support timezones in formulas, sorry for that ☹  
Will fix that! 💪

---

<div class="post-metadata">

**Author:** ![colman](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@colman](https://community.fibery.io/u/colman)\
**Post date:** [March 13, 2021, 8:33pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/3 "2021-03-13T20:33:06Z")

</div>

I believe Fibery uses UTC under the hood for all such calculations (probably because this is how JS normally does things and the clojurescript library they use wraps this? not 100% sure). I’m guessing you’re in UTC+1.

In my own formulas, I often want the Date of a given time, so use `Time.start - Hours(5)`. Of course this only works for half the year because of daylight savings: you could solve this by editing the formulas or making a lookup to another variable so that this would only have to be changed in one place, not every formula. I haven’t bothered yet as I didn’t need the precision.

For you, you could solve with `toText(Date + Hours(1))` for now (and `Hours(2)` in two weeks time! I guess in a few years the EU will get rid of daylight savings). This may not be exact enough for your needs in general, but could help.

---

<div class="post-metadata">

**Author:** ![AndreasHe\_daic](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@AndreasHe\_daic](https://community.fibery.io/u/AndreasHe_daic)\
**Post date:** [March 14, 2021, 1:56pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/4 "2021-03-14T13:56:14Z")

</div>

Yes, the idea with shifting the hour is an idea. But you are right with the daytime problem twice a year.

Just wait for the fix. Maybe an own function dateToText(date,format,zone) is also an idea.

---

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [May 20, 2021, 9:09pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/5 "2021-05-20T21:09:27Z")

</div>

Yeah, timezones are generally a huge pain to deal with. Handling it by using simple hour offsets is setting yourself up for failure.

Like you said, if we could have whatever library that Fibery uses be exposed as a `dateToText(...)` and `textToDate(...)` formula that would be truly awesome.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [May 21, 2021, 6:08am UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/6 "2021-05-21T06:08:07Z")

</div>

Probably/possibly related to this issue which is dates only

> [@\[FIXED\] Converting an End date to text](https://community.fibery.io/t/converting-an-end-date-to-text/1302):
>
> If I create a Date field with Start and End dates, when I use the ToText function on the End date: ToText(Date.End) I don’t get what I expect, but the next day instead. i.e. the ToText function will return the 14th January for an End date set to 13th January. I imagine that it’s possibly because Date fields with Start and End dates are internally stored as running from midnight in the morning of the first day, to midnight in the evening of the last day, if you know what I mean. Or it’s just…

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [August 18, 2021, 12:24pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/7 "2021-08-18T12:24:04Z")

</div>

FYI:

> **[Timezones](https://help.fibery.io/en/articles/5499837-timezones)**
>
> See how timezones \[do not\] work in Fibery and how to handle it in Formulas, Automations, Reports and etc.

---

<div class="post-metadata">

**Author:** ![helloitse](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/helloitse/32/498_2.png) [@helloitse](https://community.fibery.io/u/helloitse)\
**Post date:** [August 18, 2021, 7:16pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/8 "2021-08-18T19:16:11Z")

</div>

Workarounds for timezones should be a short term and not a long term solution. It’s not reasonable to pitch Fibery as a remote work “second brain for teams” if my whole team needs to be in the same timezone.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [August 18, 2021, 7:42pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/9 "2021-08-18T19:42:49Z")

</div>

Here’s a thought experiment, and I’m curious to hear what people think.  
Given that it is ideal if multiple people from different time zones can work in Fibery simultaneously, even editing the same entity simultaneously, how should a text field that contains a date-to-text conversion be shown to these different users?  
The same for all users, or different?

Also, what about functions like Day() or Month() that are intended to extract the day or month of a date as a number?

---

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [August 18, 2021, 9:32pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/10 "2021-08-18T21:32:29Z")

</div>

What I don’t get is why reinvent the wheel? I’m sure there will be extra effort to reengineer some internals, but there’s plenty of libraries that have figured out how to handle nearly all the edge cases for working with date, time, datetime, and timezones. For example: [https://momentjs.com/](https://momentjs.com/) and [Day.js · 2kB JavaScript date utility library](https://day.js.org/en/)

To answer your thought experiment:

`dateToText(date)` → date in UTC as string in default format

`dateToText(date, tz)` → date in `tz` as string in default format

`dateToText(date, tz, fmt)` → date in `tz` as string in the `fmt` format

For all the above the users time or timezone is irrelevant. For example,

`dateToText(Now(), tz)` → Now() converted to `tz` as string in default format

`dateToText(someDatetime, tz)` → someDatetime (stored as UTC serverside) converted to `tz` as string in default format

Text to date would function very similarly, but convert the output date depending on what the users set locale is.

`textToDate(text, tz, strFmt)` → date string is assumed to be in `tz`, saved to server as UTC, displayed on UI in users locale (or settings timezone)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [August 18, 2021, 9:49pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/11 "2021-08-18T21:49:50Z")

</div>

Since I’m not a sw guy with experience of these libraries, can you tell me, for something like `dateToText(someDatetime, tz)`  
is it correct that the every user would see the same thing (so it will be ‘correct’ only for the chosen timezone)?  
And does the result change as the clocks go back/forward in that timezone/location?

---

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [August 19, 2021, 12:02pm UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/12 "2021-08-19T12:02:19Z")

</div>

Yeah every user would see the time in the specified timezone with the appropriate time correction applied.

I suppose if you wanted to have the option where it was shown in the user’s local time you could make it happen when “local” was entered for `tz`. Example:

`dateToText(someDatetime, "LOCAL")` → someDatetime (stored as UTC serverside) converted to users local timezone (or settings timezone) as string in default format

---

<div class="post-metadata">

**Author:** ![RonMakesSystems](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ronmakessystems/32/14122_2.png) [@RonMakesSystems](https://community.fibery.io/u/RonMakesSystems)\
**Post date:** [March 13, 2025, 11:14am UTC](https://community.fibery.io/t/totext-date-wrong-timezone/1441/13 "2025-03-13T11:14:17Z")

</div>

This bug is still open. Any known workarounds?
