当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - How do I set the system time?

问题描述:

On windowsXP and onwards, if you set the datetime to hijri calendar an option is provided to adjust it in "Regional and Language Options".

What I want to do is to either adjust the hijri date using C# or set system date to my own calculated hijri system date?

Any help

网友答案:

Changing system datetime can be done by importing the SetLocalTime function:

[DllImport("kernel32.dll")]
static extern bool SetLocalTime([In] ref SYSTEMTIME lpLocalTime);

You have to calculate your local time based on the hijri time.

分享给朋友:
您可能感兴趣的文章:
随机阅读: