Time - PowerCram Blog

Set Time Zone From Command Line in Windows 2003, XP and 2000

Quick and easy way to set timezone from command line in Windows 2003, XP and 2000. CONTROL.EXE TIMEDATE.CPL,,/Z Eastern Standard TimeCONTROL.EXE TIMEDATE.CPL,,/Z Central Standard TimeCONTROL.EXE TIMEDATE.CPL,,/Z Mountain Standard TimeCONTROL.EXE TIMEDATE.CPL,,/Z Pacific Standard Time These are a little longer but they do the same thing. RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Eastern Standard TimeRunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Central Standard TimeRunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Mountain […]

SQL: How to extract Year, Month, Day, Hour, Minute and Seconds from a DateTime

The DATEPART function accepts two parameters : DATEPART ( datepart , date ) wheredatepart – specifies the part of the date to return. For eg: year, month and so ondate – is the datetime or smalldatetime value QUERY SELECTDATEPART(year, GETDATE()) as ‘Year’,DATEPART(month,GETDATE()) as ‘Month’,DATEPART(day,GETDATE()) as ‘Day’,DATEPART(week,GETDATE()) as ‘Week’,DATEPART(hour,GETDATE()) as ‘Hour’,DATEPART(minute,GETDATE()) as ‘Minute’,DATEPART(second,GETDATE()) as ‘Seconds’,DATEPART(millisecond,GETDATE()) as ‘MilliSeconds’ Note: When […]

Set the Time Zone from the command line on Windows computers

To set the Time Zone from the command line, use: RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%system32TIMEDATE.cpl,,/Z where is the data value of the Display Value Name, or the Std Value Name ,at HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrent VersionTime Zones. You can also use: Control.exe %SystemRoot%system32TIMEDATE.CPL,,/Z . Example:RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%system32TIMEDATE.cpl,,/Z US Eastern Time NOTE: You do NOT encapsulate the time zone string in quote (“) […]

Time Windows 2000 SERVER

C:>net time /querysntpThis computer is not currently configured to use a specific SNTP server.The command completed successfully. For a list of NTP servers, see this page. Let’s configure it for clock.isc.org: C:>net time /setsntp:clock.isc.orgThe command completed successfully. Verify that it stuck: C:>net time /querysntpThe current SNTP value is: clock.isc.orgThe command completed successfully. You may need to bounce w32time […]