May 31st, 2014

PowerTip: Use PowerShell to Report Daylight Savings Time

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to report if it is daylight savings time.

Hey, Scripting Guy! Question How can I use Windows PowerShell to report if it is daylight savings time?

Hey, Scripting Guy! Answer Use the Get-Date cmdlet, and call the IsDaylightSavingTime method from the DateTime object:

(Get-Date).IsDaylightSavingTime()

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback