Formula with Date and Time

Are you using our SaaS platform (Baserow.io) or self-hosting Baserow?

SaaS

What are the exact steps to reproduce this issue?

I have a table with a Date & Time column and a Sample ID column, where the Sample ID is a rollup from another table.

I want my primary field to consist of SampleID_DateTime, so I created the following formula:

concat(field(‘Sample ID’), ‘_’, field(‘Deposition Date & Time 1’))

However, for some reason, the time displayed in the primary field is 2 hours earlier than the value shown in the Deposition Date & Time 1 column. For example, if the Date & Time field shows 14:00, the primary field displays 12:00.

I don’t understand why this is happening or how to fix it. Has anyone experienced this before or knows what could be causing it?

Hey @ThomasShehata, it looks like a bug, so I’ve asked the dev team to take a look. I’ll let you know as soon as I hear back about this. :slightly_smiling_face:

Hey @ThomasShehata, I just got a response from the devs. The good news is that it’s not a bug. The concat function uses the UTC-localized date.

To use your local timezone, you’ll need to use datetime_format_tz and pass the timezone you want to localize the date to.

concat(
  field('Sample ID'),
  ';',
  datetime_format_tz(
    field('Deposition Date & Time'),
    'YYYY-MM-DD HH24:MI',
    'Europe/Amsterdam'
  )
)

Thank you so much! This helps a lot!