Tariq Mehmood
Tariq Mehmood

Reputation: 269

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

Upvotes: 0

Views: 226

Answers (1)

Peter
Peter

Reputation: 27934

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.

Upvotes: 1

Related Questions