How Many Days Till New Year
If someone ever asks you,” How long is it till new year (or any day for that matter)?” Below is a little PowerShell date math routine I borrowed from Jeffrey Snover, the architect of PowerShell.
Function TillNewYear
{
$Now = [DateTime]::Now
[Datetime]([string] ($now.Year + 1) + "-01-01") - $Now
}
TillNewYear