Current date/time in Data column?

Is there a way to create a data column with the current date/time at a specific time zone?

I have some user actions that move user-specified dates out to the coming Monday or Saturday, and my solution would be less hacky if I could do some simple date math based on the current time.

1 Like

Are users in multiple timezones? In other words, would the timezones offset anyways be the same or could it differ for each user? Which time zone would you want?

1 Like

Just one user — me. I could mostly get away without dealing with time zones but I do want this app to work as expected when I travel. I would be OK manually specifying the canonical time zone somewhere.

1 Like

Got it. Since you will be traveling, your timezone will change on you.
I will mention this, because it may or may not be enough for your use case, but there is an option to select Respect Timezone in a Date column, which should automatically adjust the time if your timezone changes, but I think it also depends on the timezone of the user when they added the row. I think it stores UTC time underneath and adjusts according to the user.

Otherwise, I would do a little math to get the time in a different timezone regardless of where you are currently located.

First, create a FormatDate column to figure out the current user’s timezone offset.

Next create a Math column. If you just wanted the current date and time, you could just use the Now portion, but since you want a specific timezone, there’s a little more to it.
First we take Now, which will be the current date and time for the user, then we want to subtract the offset number. This should put us at UTC time. From there we add the Offset value to get the the desired timezone. In the screenshot below, I started with My current time of 12:30pm. Using the Offset value from the other column, I calculate to 5:30pm. Then finally, I want UTC+5, so I add 5 hours to get a final value of 10:30PM.

2 Likes

Thanks, this seems to be working!

2 Likes