# Change Timezone

**URL:** <https://forum.uipath.com/t/change-timezone/455618>\
**Category:** Studio\
**Tags:** datetime, timezone, system, activities\
**Created:** [July 11, 2022, 3:18pm UTC](https://forum.uipath.com/t/change-timezone/455618 "2022-07-11T15:18:27Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 11, 2022, 3:18pm UTC](https://forum.uipath.com/t/change-timezone/455618/1 "2022-07-11T15:18:27Z")

</div>

Hi,

I use Now.ToString(“dd-MM-yyyy HH:mm:ss”) for my date and it’s work in local. But when i run my process on the tenant, i’m not in UTC+2 (French time) but in UTC+0.

For example, in local i have 17:15 but in tenant i have 15:15.

I try many solutions found on the web but that doesn’t work or i don’t understand ☹

Who can help me with that ?

Thanks !

---

<div class="post-metadata">

**Author:** ![Jose\_Cunha](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jose_cunha/32/316459_2.png) [@Jose\_Cunha](https://forum.uipath.com/u/Jose_Cunha)\
**Post date:** [July 11, 2022, 3:24pm UTC](https://forum.uipath.com/t/change-timezone/455618/2 "2022-07-11T15:24:14Z")

</div>

Hello,

Try this:

> [@Solution on how to convert DateTime variables between UTC and Local or a specific timezone](https://forum.uipath.com/t/solution-on-how-to-convert-datetime-variables-between-utc-and-local-or-a-specific-timezone/191318):
>
> Convert from UTC to a specified timezone. We can use the [TimeZoneInfo.ConvertTimeFromUtc](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.converttimefromutc) static method in an Assign activity (Invoke Method can work as well), setting first parameter to the UTC DateTime object and the second parameter to a [TimeZoneInfo](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo) object which represent the target Timezone. The TimeZoneInfo object can be created with the help of [TimeZoneInfo.FindSystemTimeZoneById](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid) method where we need to specify the name of the timezone we want, like India Standard Time or Tokyo Standard…

---

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 11, 2022, 3:27pm UTC](https://forum.uipath.com/t/change-timezone/455618/3 "2022-07-11T15:27:57Z")

</div>

Hello,

I have already try this, but i don’t understand how it’s work 😕

---

<div class="post-metadata">

**Author:** ![Nithinkrishna](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nithinkrishna/32/561519_2.png) [@Nithinkrishna](https://forum.uipath.com/u/Nithinkrishna)\
**Post date:** [July 11, 2022, 4:09pm UTC](https://forum.uipath.com/t/change-timezone/455618/4 "2022-07-11T16:09:16Z")

</div>

Hey @Christopher_p

What do you mean by trying in tenant ?

Thanks  
#nK

---

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 11, 2022, 4:24pm UTC](https://forum.uipath.com/t/change-timezone/455618/5 "2022-07-11T16:24:25Z")

</div>

Hey !

I mean, the orchestrator. We have one for dev, one for rec and one for prod.

---

<div class="post-metadata">

**Author:** ![marian.platonov](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marian.platonov/32/260263_2.png) [@marian.platonov](https://forum.uipath.com/u/marian.platonov)\
**Post date:** [July 11, 2022, 5:51pm UTC](https://forum.uipath.com/t/change-timezone/455618/6 "2022-07-11T17:51:10Z")

</div>

You may try this:

str\_datetime = Datetime.Now.AddHours(2).ToString()

Also, you may check which is the tenant timezone:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/0/f/1/0f1fb8becb231c40fb6ea4d906f47f64637b6fe1.png)

More details about tenant settings: [Configuring tenant settings at the tenant level](https://docs.uipath.com/orchestrator/docs/configuring-tenant-settings)

---

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 11, 2022, 5:58pm UTC](https://forum.uipath.com/t/change-timezone/455618/7 "2022-07-11T17:58:55Z")

</div>

Hi Marian,

If i add 2 hours in my date, in local i will have H+2

The timezone in application settings is on UTC+2. Because in France we have UTC+2 in summer and UTC+1 in winter. So i need to dynamize that 😕

---

<div class="post-metadata">

**Author:** ![Nithinkrishna](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nithinkrishna/32/561519_2.png) [@Nithinkrishna](https://forum.uipath.com/u/Nithinkrishna)\
**Post date:** [July 12, 2022, 2:24am UTC](https://forum.uipath.com/t/change-timezone/455618/8 "2022-07-12T02:24:31Z")

</div>

So @Christopher_p

You are running the process in some other machine and you want to maintain time in France timezone is that correct ?

---

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 12, 2022, 8:37am UTC](https://forum.uipath.com/t/change-timezone/455618/9 "2022-07-12T08:37:56Z")

</div>

> [@Nithinkrishna](#):
>
> You are running the process in some other machine and you want to maintain time in France timezone is that correct ?

Yes ! When i go in the machine, time is the same i have on my computer, so i don’t understand why i have H-2 on my process in this machine

---

<div class="post-metadata">

**Author:** ![Felix\_Effendi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/felix_effendi/32/301292_2.png) [@Felix\_Effendi](https://forum.uipath.com/u/Felix_Effendi)\
**Post date:** [July 12, 2022, 9:55am UTC](https://forum.uipath.com/t/change-timezone/455618/10 "2022-07-12T09:55:42Z")

</div>

hi @Christopher_p ,  
What i get here is,  
first : your local PC has a different timezone with your tenant machine, u’re UTC+2 and Tenant UTC+0. is it correct?

if it’s correct, secondly : what u want is, u want to have a same result for the time either in local or tenant? i.e Local 17.15 & Tenant 17.15 (which is should + 2 hours).

Is it correct?

---

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 12, 2022, 11:38am UTC](https://forum.uipath.com/t/change-timezone/455618/11 "2022-07-12T11:38:08Z")

</div>

Hi Felix,

When I connect to the server, it is at the same time as my local PC, yet my files come up with the time UTC+0 which I don’t understand.

I want have same hour on my files as on my local PC, yes !

Thanks

---

<div class="post-metadata">

**Author:** ![Nithinkrishna](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nithinkrishna/32/561519_2.png) [@Nithinkrishna](https://forum.uipath.com/u/Nithinkrishna)\
**Post date:** [July 12, 2022, 11:45am UTC](https://forum.uipath.com/t/change-timezone/455618/12 "2022-07-12T11:45:32Z")

</div>

What’s the code you’re using currently for that time thing please ?

---

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 12, 2022, 11:49am UTC](https://forum.uipath.com/t/change-timezone/455618/13 "2022-07-12T11:49:51Z")

</div>

I use : Now.ToString(“dd-MM-yyyy HH:mm:ss”)

---

<div class="post-metadata">

**Author:** ![Felix\_Effendi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/felix_effendi/32/301292_2.png) [@Felix\_Effendi](https://forum.uipath.com/u/Felix_Effendi)\
**Post date:** [July 12, 2022, 12:33pm UTC](https://forum.uipath.com/t/change-timezone/455618/14 "2022-07-12T12:33:32Z")

</div>

Hi Christoper,  
Ah i see, so basically your local & machine have a same time which is UTC + 2, but when u produce your file using Now.ToString(“dd-MM-yyyy HH:mm:ss”), it shows UTC + 0, is it?

---

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 12, 2022, 12:54pm UTC](https://forum.uipath.com/t/change-timezone/455618/15 "2022-07-12T12:54:52Z")

</div>

> [@Felix\_Effendi](#):
>
> Ah i see, so basically your local & machine have a same time which is UTC + 2, but when u produce your file using Now.ToString(“dd-MM-yyyy HH:mm:ss”), it shows UTC + 0, is it?

Yes it’s for what i search for function for keep my UTC+2 or (“French/Paris”). Because we have UTC+1 and UTC+2 in France if we are in summer or winter

---

<div class="post-metadata">

**Author:** ![marian.platonov](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marian.platonov/32/260263_2.png) [@marian.platonov](https://forum.uipath.com/u/marian.platonov)\
**Post date:** [July 12, 2022, 8:20pm UTC](https://forum.uipath.com/t/change-timezone/455618/16 "2022-07-12T20:20:34Z")

</div>

Better to keep all the time in the UTC timezone as in the Rest API calls, the date data are presented in the UTC (Coordinated Universal Time) timezone.

As the UTC/GMT never changes, but rather the country adheres to a different time-zone during DST, we are not changing it either in the Orchestrator.

You may try these approaches:

In case you need the local time, use this code:

```auto
"Local Time: " + DateTime.ParseExact(Convert.ToString(Now),"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).AddHours(0).ToString

```

In case you need the UTC time, use this code:

```auto
"Time in UTC: " + TimeZoneInfo.ConvertTimeToUtc(DateTime.Parse(Convert.ToString(Now))).ToString

```

Or you can do this if you need to keep all the time +2 hours in UTC:

```auto
"Time in UTC +2: " + TimeZoneInfo.ConvertTimeToUtc(DateTime.Parse(Convert.ToString(Now))).AddHours(2).ToString

```

_Example:_

![image](https://global.discourse-cdn.com/uipath/original/4X/4/b/8/4b87611cdfb8ef921c78e7afa41b0281fbe087ff.png)

---

<div class="post-metadata">

**Author:** ![Christopher\_p](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/christopher_p/32/252177_2.png) [@Christopher\_p](https://forum.uipath.com/u/Christopher_p)\
**Post date:** [July 13, 2022, 8:53am UTC](https://forum.uipath.com/t/change-timezone/455618/17 "2022-07-13T08:53:53Z")

</div>

Thanks, it’s more understandable for me !

I can just change the Addhours(2) by Addhours(1) when we are in winter time and keep 2 for DST, thanks !

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [July 16, 2022, 9:28am UTC](https://forum.uipath.com/t/change-timezone/455618/19 "2022-07-16T09:28:46Z")

</div>

Closed on July 16, 2022, 9:28am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
