Ways to know time/date from user's point of view? (From different time zones)

Hey all!

I have an admij page which shows users’ actions with a field for their date/time

I went abroad and noticed that I see these fields now from my new time zone and not with the users’ time

My goal is to see on the admin page for each action the time it occurred from the user’s perspective in his own time zone

Not sure how to approach this. Any thoughts

Thanks!

You can have timezone set to current user or current data

1 Like

To do that you’d have to store the User’s time zone on the related database object, and then use that time zone when displaying the date/time.

Or better still, just store and display all dates/time in a fixed time zone (i.e. UTC).

Thanks! @adamhholmes That does sound like the solution I was looking for.

About storing it with UTC, how is that being done? Is it different than just storing “current date/time”?

Actually… having re-read your initial post… I’m not sure that is a good idea here…

Unless you want to duplicate the timestamps (i.e. keep the original timestamp, and also have a duplicate field to convert the timestamp into the same time in UTC… you’ll need a plugin or some custom JS to do that though), so you don’t lose the original timestamp.

You’re probably better off using the User’s actual time zone to display the times on your admin page - so you’ll need to store the User’s time zone somewhere in the database and access that.

1 Like

Got it, Thanks that helps a lot

1 Like

Hey @siddharth what do you mean by setting the timezone to current data?