开发者

How to change the UTC Time

开发者 https://www.devze.com 2023-03-16 04:28 出处:网络
I have developed my application in c#. In this application OPC 开发者_运维知识库Server returns the UTC Time automatically. But the issue is I want to change this UTC Time same as System Time. (The dif

I have developed my application in c#. In this application OPC 开发者_运维知识库Server returns the UTC Time automatically. But the issue is I want to change this UTC Time same as System Time. (The difference between System Time & UTC Time is 5.30)


I believe you are looking for DateTime.ToLocalTime


First check if the Kind property is DateTimeKind.Utc then toLocalTime() would be enough else you will have to use AddHours and AddMinutes

0

精彩评论

暂无评论...
验证码 换一张
取 消