Oye, that’s frustrating. My post in the other thread wasn’t dealing with anything server side, so maybe we need a different approach here.
Let’s talk it out. What I assume is happening is that Glide always converts and stores dates to ISO 8601 as UTC ('Z’ulu) time. I’m making assumptions, but I think the “respect timezone” option for date columns is a bit of smoke and mirrors. If respect timezone is unchecked, the ISO formatted UTC timezone is ignored and the time is interpreted as local time even though it has the ‘Z’ for zulu time. Or it’s maybe possible that Glide hard stores the offset from the user entering the date at the time of entry applies that same offset to the stored UTC time for everyone. By most standards, what is stored would be considered UTC time, but I think Glide tends to either ignore that if timezone is not respected or applies the hard set timezone for everyone. One the flip side, if the respect timezone box is checked, then glide respects the ‘Z’ part of the date and does a timezone conversion of that UTC date to each user’s local time.
So all in all, I believe Glide is always storing dates as UTC time. When you run a server side workflow, it doesn’t know your timezone, so it always interprets the date and time as it’s stored in the database which is UTC, which is 4 hours later than your local time.
Now pretend you live in the UTC timezone and you are the server. The server is doing the same computed column logic that you are doing locally. But, the server has a timezone offset of 0, so it’s going to take that original time that was entered as 1PM EDT and stored as 5PM UTC, and then it applies the offset of zero, which is still 5PM UTC.
I didn’t ask if you are using the ‘respect timezone’ option, and I’m not sure if it would make a difference or have weird results with already stored values.
First I would try changing the respect timezone box to see if that changes anything. If not, the server might be ignore it, so I think the proper approach would be to compute the timezone offset and then store it in a basic column so it persists when it hits the server. You should still be able to use a math column to add that offset (add the stored basic column offset to your date), which will be re-evaluated on the server. The server will still do the math, but it will apply the stored -4 to your UTC stored time instead of applying it’s own offset of 0. That way you should end up with the correct time in your email.
It would be so nice if Glide would actually explain some of their logic so we don’t have to try to figure this out ourselves.