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 […]

Windows 7 (and Windows 2008) Command Line Utility to Change Time Zone

Here is a great hidden command line utility which is available starting in Windows 7, “tzutil.exe,” which can be used to view or change the computer’s Time Zone. To use this command: 1. Open the Command Prompt.2. Enter any of following commands: tzutil /g (To view current time zone) tzutil /l (To get a list of all available time […]

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 […]

SQL SERVER – Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime

Get Current Date & Time select GetDate() SQL Server 2000/2005 SELECTCONVERT(VARCHAR(8),GETDATE(),108) AS HourMinuteSecond,CONVERT(VARCHAR(8),GETDATE(),101) AS DateOnlyGO SQL Server 2008 SELECTCONVERT(TIME,GETDATE()) AS HourMinuteSecond,CONVERT(DATE,GETDATE(),101) AS DateOnlyGO

Windows 7 Command Line Utility for Timezone Management – tzutil.exe

“tzutil.exe” is a command line utility introduced in Windows Vista (also in Windows 7 and Windows 2008) which can be used to change Time Zone or to view the current time zone information. To use this command (from a command prompt as administrator): tzutil /g – To view current time zonetzutil /l – To get […]

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 […]

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 […]