术语 | setlocaltime |
释义 | SetLocalTime 语法: C++ BOOL WINAPI SetLocalTime( __in const SYSTEMTIME *lpSystemTime ); SetLocalTime函数 设置当前本地时间和日期。 参数 lpSystemTime [in] 一个SYSTEMTIME结构,它包含了新的本地日期和时间的指针。 该SYSTEMTIME结构wDayOfWeek成员被忽略。 返回值 如果函数成功,返回值为非零。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 该SetLocalTime功能可改变之前,当地时间SE_SYSTEMTIME_NAME特权。这种特权是默认禁用。有关更多信息,请运行特权。 该系统使用UTC内部。因此,当调用SetLocalTime,该系统采用当前的时区信息来执行转换,包括夏令时间设置。请注意,系统使用夏令时的当前时间设置,而不是新的时间您正在设置。因此,为了确保正确的结果,调用SetLocalTime第二次,现在第一次调用已更新夏令时间设置。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 GetLocalTime GetSystemTime 当地时间 SetSystemTimeAdjustment 系统时间 时间函数 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==SetLocalTime Function Sets the current local time and date. Syntax C++ BOOL WINAPI SetLocalTime( __in const SYSTEMTIME *lpSystemTime ); Parameters lpSystemTime [in] A pointer to a SYSTEMTIME structure that contains the new local date and time. The wDayOfWeek member of the SYSTEMTIME structure is ignored. Return Value If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError . Remarks The SetLocalTime function enables the SE_SYSTEMTIME_NAME privilege before changing the local time. This privilege is disabled by default. For more information, see Running with Special Privileges . The system uses UTC internally. Therefore, when you call SetLocalTime, the system uses the current time zone information to perform the conversion, including the daylight saving time setting. Note that the system uses the daylight saving time setting of the current time, not the new time you are setting. Therefore, to ensure the correct result, call SetLocalTime a second time, now that the first call has updated the daylight saving time setting. Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also GetLocalTime GetSystemTime Local Time SetSystemTimeAdjustment SYSTEMTIME Time Functions Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms724936(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。