I have a date field with start time:
I then calculate with this formular
moment(@Termin).format('DD.MM.YYYY - HH:MM')
Result should not be:
- why is it 6 min? - the 6 min are not related to the creation time, as it was around min 15…
- what are the timezones? - do I need to add timezones? It should just pick the shown date and convert the string.
I expected: “28.06.2023 - 14:00”
thanks for bringing this up - let’s solve your issue right away.
There are two aspects leading to the unexpected behaviour.
The first thing is your format string. The capital letter
M refers to the month, see here. So what you meant to write was most likely this format string:
DD.MM.YYY - HH:mm. That will improve the result and remove the “mysterious 6”, but still display the date in UTC:
The reason is that Tape calculation fields always run in UTC, as they need to work the same for every user and organization. However, if you need to format the date relative in a certain timezone, it can be easily done using this code:
moment(@YourToken).tz("Europe/Amsterdam").format('DD.MM.YYYY - HH:mm')
Now, we receive the expected output:
I hope that solves your problem. Feel free to reach out here if you have further questions regarding this.
Great - another “layer 8” issue solved. Thanks a lot for the speedy response.