# How to show the current time of a specifc country?

**URL:** <https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320>\
**Category:** Ask for Help\
**Created:** [September 12, 2024, 1:33pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320 "2024-09-12T13:33:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aeson](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aeson](https://community.glideapps.com/u/aeson)\
**Post date:** [September 12, 2024, 1:33pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/1 "2024-09-12T13:33:20Z")

</div>

My app would be used by users from different countries and I would like to show the current time of a specific country, say, Italy UTC +1. How would I achieve this?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 12, 2024, 2:00pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/2 "2024-09-12T14:00:39Z")

</div>

If you create a math column, give it a formula like ‘X’ and replace X with Now, it will show the current time respectively for each user based on the time on their device.

Or do you mean that you only want to show Italy time regardless of who is viewing your app?

---

<div class="post-metadata">

**Author:** ![aeson](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aeson](https://community.glideapps.com/u/aeson)\
**Post date:** [September 12, 2024, 2:05pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/3 "2024-09-12T14:05:14Z")

</div>

Yes, you are right. Regardless of where users are from, they will only see the current time of Italy. Would you know how to do it?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 12, 2024, 2:16pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/4 "2024-09-12T14:16:07Z")

</div>

The Format Date column with a ‘Z’ code will give you the UTC offset for the current user. Using that you can use the following math formula to calculate UTC time.

Now=Now  
T=Offset

```auto
Now+((T*-1)/24)

```

But to get to an offset of +1, just add an addition of 1 to the formula.

```auto
Now+((T*-1+1)/24)

```

---

<div class="post-metadata">

**Author:** ![aeson](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aeson](https://community.glideapps.com/u/aeson)\
**Post date:** [September 12, 2024, 2:34pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/5 "2024-09-12T14:34:11Z")

</div>

Hi Jeff, thank you for your solution. I think I understand what you are trying to do with Now+((T\*-1+1)/24) … based on user’s respective current time find the UTC offset. But how exactly do I calculate user’s UTC offset as in T=Offset? and what did you mean by Format Date column with a Z code?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 12, 2024, 3:00pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/6 "2024-09-12T15:00:43Z")

</div>

![Screenshot_20240912-100025](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/7/c7af3d3b96832420d356f06e46f8c11a372f4bb8.jpeg)

---

<div class="post-metadata">

**Author:** ![aeson](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@aeson](https://community.glideapps.com/u/aeson)\
**Post date:** [September 12, 2024, 6:05pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/7 "2024-09-12T18:05:26Z")

</div>

Hi Jeff, thank you for your solution and it works. I was skeptical at first as I wasn’t sure about the Format Z initially. Btw, since there is daylight saving now (hence UTC +2), I changed the formula to Now+((T\*-1+2)/24).

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 12, 2024, 7:26pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/8 "2024-09-12T19:26:31Z")

</div>

I think I have a solution for the DST issue, so it will adjust automatically.

Create a javascript column and paste this code into it. This should determine the current offset for Italy factoring in whether it’s DST or not.

```auto
// Get the current date and time in the Rome timezone
let date = new Date();
let options = { timeZone: 'Europe/Rome', timeZoneName: 'short' };
let formatter = new Intl.DateTimeFormat('en-US', options);
let parts = formatter.formatToParts(date);
let offsetString = parts.find(part => part.type === 'timeZoneName').value;

// Extract numeric offset from the timezone name
let offset = parseInt(offsetString.match(/([+-]\d+)/)[0], 10);

return offset;

```

Then change your math column to this. D will equal the value returned from the javascript column.

```auto
Now+((T*-1+D)/24)

```

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 12, 2024, 11:47pm UTC](https://community.glideapps.com/t/how-to-show-the-current-time-of-a-specifc-country/76320/9 "2024-09-12T23:47:57Z")

</div>

If you have access to the Call API action, a GET request to [https://worldtimeapi.org/api/timezone/Europe/Rome](https://worldtimeapi.org/api/timezone/Europe/Rome) would also provide a utc\_offset.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/8/98fc94d5f3bb2033aca6fbd2ebf12024e84f811c.png)
