Lessons Learned

My drop-site for interesting snippets and tips. If it's useful to you as well, great!

Browse by Tags

Tagged Content List
  • Blog Post: Parsing Dates by Hand

    I’m always impressed by the amount of variety in input formats that Get-Date can accept and still parse it into a date. However, there is one time that it vexes me: US vs. EU date strings.  Specifically, the US uses dd/MM/[yy]yy, while the EU uses MM/dd/[yy]yy.  In my mind, neither make sense;...
  • Blog Post: One-Liner: GetDateTimeFormats

    DateTime objects are amazing. You can format them in so many different ways, but they also come with a boatload formats pre-defined. Oh, and it uses the current culture. So much cleaner. But which is which? $i = 0; ( Get-Date ).GetDateTimeFormats() | Select-Object @{name = 'index' ; expression = ...
Page 1 of 1 (2 items)