toText(Date) wrong timezone?

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?

Yes, our bug. We don’t support timezones in formulas, sorry for that :frowning:
Will fix that! :muscle:

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.

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.

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.

1 Like

Probably/possibly related to this issue which is dates only