Go to content Go to navigation Go to search

Brokenwire.NET::Programming

Calculate your age
· 2008-04-03 11:52 by Thijs Kroesbergen for Brokenwire.NET

Find out how old you are, in days... using PowerShell!

Ready? Here it comes:

([Datetime]::now - (new-object datetime(1981,09,26))).TotalDays

I'm currently 9686 days old. For a more dramatic effect you can replace the .TotalDays with .TotalHours (or minutes, seconds, milliseconds depending on the level of the effect you want to achieve).

Enjoy!

Permalink -