Formatting dates from text or objects

Ever imported data just to have a non readable date stamp?

Get-date can take your text that is a date and turn it into something more readable.

Take “15-FEB-20” for example. It’s not really a wildly used format.

Pipe that to get-date like so:

Then you can format your date to remove time and what not.

If you have imported the data you can fix the entry using the select statement.

$data |select name,@{name=’Birthday’;e={$_.birthday | get-date -format MM-dd-yyyy}}

Published by Xajuan Smith

Computer Information Specialist, with a desire to make the masses feel what I was born to channel...The emotion that strives us to do more, speak more boldly and with most sincere ideals that will make life easier and will not hinder the dreams we all have at any given time.

One thought on “Formatting dates from text or objects

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: