Unix timestamp in powershell

I was a bit playing with powershell. I wanted to know the week of month, day of weeks, and other gems. It is chockingly easy !

Unix Timestamp :
PS> get-date -uformat %s

To get the day of week as number, you can chose between [int](get-date).dayofweek and get-date -uformat %u

What does uformat stand for ? Unix Format ! This is probably why powershell is so good, they integrated all unix and .net goodies in one tool 🙂

Ok, one more, get the week of month :
PS> (Get-WmiObject Win32_LocalTime).weekinmonth

By Laurent Schneider

Oracle Certified Master

One reply on “Unix timestamp in powershell”

Leave a Reply

Your email address will not be published.