Is it possible to set Windows' timezone, daylightsavingtime, and ntp?

정호 송 20 Reputation points
2024-01-09T07:13:12.5033333+00:00

I am developing a function to change Windows timezone and ntp settings using C++ language. I know how to change settings with the cmd command or change the timezone and ntp settings by changing the registry. But as a developer I want to change this to source code through a library. Is there a way? Please, please.

Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
992 questions
Microsoft Configuration Manager Application
Microsoft Configuration Manager Application
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Application: A computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end users.
492 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

Accepted answer
  1. Sedat SALMAN 13,985 Reputation points MVP
    2024-01-09T08:52:31.66+00:00

    In CPP you can refer to the following function (in the link there also have a detailed explanation and example)

    https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-settimezoneinformation

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. 정호 송 20 Reputation points
    2024-01-09T09:21:43.4+00:00

    Thank you very much for your reply. Thanks to this, the time zone issue was resolved. Can you tell me if there is an API related to NTP settings? For example, changing the NtpServer output as a result of w32tm /dumpreg /subkey:Parameters. Please, please.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.