Date in VM vs Date in Orchestrator

Hello,

I’m confused about how the bot gets the date. I just want to get the current system/machine’s date

As you can see, it’s showing 18/10/2021 however, the date in the virtual machine is already 19/10/2021.

I am just using this code to display the date - Date.Now.ToString(“dd/MM/yyyy”). Now, if I logged in to the virtual machine and run the code, it will show me 19/10/2021 which is the current date in the virtual machine. However, when running it via the orchestrator (using the same virtual machine) the value becomes 18/10/2021. Btw, the date in the BOX is assigned to a variable, I’m just showing it in the logs.

I’m not sure what is happening. Date.Now.ToString(“dd/MM/yyyy”) should get the machine’s date right? Please advise.

did you change the timezone on the Orchestrator settings?

Hi

Yeah it should show the timing as per the server timezone been set

Can you check once whether the bot is running in that server only with that time zone

And try running it once in a studio in that server itself and use a writeline activity to view the Datetime in output panel

Let’s debug in that server studio itself
If will give an idea

Cheers

@Lee_Phay_Kho

No, I did not change any time zone setting in the orchestrator. What confuses me is when running the bot in the UiPath Studio inside the server it will give the server time. But if running the bot via orchestrator, it is giving a different time.

Even if I change the timezone in the orchestrator, I believe the bot will get the date of the server where it is currently installed/deployed, right?

Yes, I’ve done this many times before publishing the bot to the Orchestrator. The bot will show the date on the server (ie 19/10/2021). But, after publishing and running the bot via orchestrator, it is giving a different time (ie 18/10/2021).

I have not tried running the bot (via Orchestrator) while the Server is active or open though. I’ll try this one out.

my understand is
when a robot executes a process. the robot will record everything in the log file with date and time following the robot server timezone and then the log file also will be uploaded to the Orchestrator DB server in real-time.
if you check on the Database UiPath. you will see the timezone will different from the Robot server because DB will use GMT TIMezone as default.

however, when you download the log file from the Orchestrator. the date and time will same exactly as Robot Server.

correct me If i am wrong.