PowerTip: Use PowerShell to Report Daylight Savings Time

Doctor Scripto

Dr Scripto

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()

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment