Time Variable "Now"

Hi,

It seems that the Date & Time Variable “Now” will return the local time of my computer.

If my computer is several minutes before of behind the “correct time”, is there such a function to get the “correct time”?

Thank you in advance and look forward to your reply.

Hello @GhostBuster, you can use DateTime.Now.AddHours(intTimeDiff) where intTimeDiff is the time difference of your local computer and the “correct time” you are looking for.

1 Like

Hi, @avejr748,

Thank you for the reply.
Is there a straightforward way retrieve the “correct time” because most of the time the “difference” may be unknown?

@GhostBuster I don’t think so. One suggestion I can give you if you are going to refer to different locations is to have a datatable with the location name and the time difference in the location. Then lookup the datatable to know what timedifference to use

@GhostBuster

If you have internet access in your production, then you can try with some free api’s to retrieve the time of different countries

Check link below a sample api

http://worldtimeapi.org/

Mark as solution if it helps

Thanks

Thanks for the reply from @ksrinu070184 and @avejr748.

So it can be concluded that no built-in function is available to directly retrieve the “correct time”. Am I right?

Yes, because “correct time” is relative as it depends on location

Hi @GhostBuster

We have inbuilt function to get the Date and Time by using Time zone.(if you give your you will get correct time other than system time

I have created a workflow to get date time with time zones by using inbuilt function.

PFA workflow for your referenceEST_Date_Conversion.zip (51.7 KB) )

Thanks
Latika