Formatting Timestamps With Timezones For Notion

In my scenario I have a timestamp like 2024-04-11T15:45:57.593262 and the timezone for that timestamp is UTC.

I need to adjust the time to my local time which is Europe/London and I can, like this {{formatDate(4.completedAt; "YYYY-MM-DDTHH:mmZ"; "Europe/London")}}.

Which produces an ISO 8601 timestamp like 2024-04-11T15:45:00.000+01:00.

When I insert that timestamp in a Notion property, it looks like the +01:00 is stripped out because the time is still set to 3:45pm, presumably because Notion expects timezones to be set using the time_zone property thatā€™s available for dates.

But it looks like Make is already setting that for me, based on the time zone annotation -

and I donā€™t have the option to customise that property.

Iā€™ve tried lots of different formats but I canā€™t figure out how to set the timestamp to the right hour using Makeā€™s functions?

I donā€™t mind if I simply have to set the time to 2024-04-11T16:45:00.000 but Iā€™m not sure how to do that either. Iā€™d like to avoid using hardcoded time adjustments because those wonā€™t work correctly when daylight savings time comes into play.

Hi @alexs,
I think you first have to use the parseDate() function on the timestamp you ā€˜receiveā€™ and specify the timezone there to UTC timezone.
Next you can formatDate() to specify ā€œEurope/Londonā€ but this might not even be necessary if Make and Notion are already set to the correct timezones.

3 Likes

Thanks for the tip! I just assumed that formatDate() would have the same effect as parseDate() but that was what I needed. As you say, there was no need for me to format the date once it was parsed.

3 Likes