How To Capture Current Users Timezone From The Device?


Is it possible to capture the time zone WITHOUT requesting a lat/long and then calculating the time zone based on the location of the user?

As in can we simply capture the device time zone based on the settings within the device itself?


Unique question. If you created a current date/time object and passed the timestamp to your backend, would that give you the needed information as I feel like the UTC +/- would go along with it? Might be a good spot to experiment here.


So I created a current time object and displayed the date on the page and it displays with the timezone of the device itself (EDT) and I confirmed this by manually changing the time on the device and then refreshing the page to notice the change, and it did change.

I also displayed the unix time stamp in milliseconds.

On the back end, i can receive the date, but i can’t ‘extract’ the ‘EDT’ part, although somehow Dropsource is able to determine that the current date/time object is in EDT.


Current scenario:

I collect lat/long from the users device location (which requires a permission) and send that along with the date so that the date can be formatted as a text by the back end in the same time zone as the users handheld device.

This brings up issues for me when the user doesn’t give permission, as the api call fails because it expects the lat/long.

So, what I’m trying to do is simply obtain the users time zone from the device current date/time object, in my case, EDT, and then pass that time zone to the back end (or be able to extract it from the date that is sent to the back end but it doesn’t look like i can).

Is there a way to extract and send just the time zone ID/Name?

There seem to be ways to do this via Android code and get the time zone ID, for example, America/New York.


Here’s how you can get a timezone…

Format a Date to String and that use the capital Z to give you the +/- from UTC.

You’ll end up with this…
Here’s a cool resource that shows what codes are available to you for Date/Time


This is working and I’m able to format the date to get the offset from UTC using the ‘Z’ format as you suggest.

What need now is to split the minutes from the hours, in this case, -07 (hours) and 00 (minutes) and save those two values as Number type page variables so that they can be sent to the back end indepenently.

From there I can bring the constructed date back to UTC using the offset, and then save it as UTC, formatting it however it may need to be formatted from there.

How can I split -0700 by the last 2 characters preserving the first 2 characters (or 3, if negative “-” exists)?


Gotcha. Glad I could getcha that far. As for this next request, I don’t know how you’ll do that with Dropsource. You’re getting pretty funky aka custom. Better to pass it back as is to your backend to perform the magic over there I think on this 1.