I’m having an issue where my script is almost working too well.<\/p>\n
Advertisement
I need a column of dates in .csv files to be in format yyyyMMdd. This works fine, except for when that data is already in yyyyMMdd format, at which point it turns blank.<\/p>\n
I’m not sure how to have my script check if the date is in format already, and skip if it is. What I have right now is as follows:<\/p>\n
$Properties is an array of the column headers for the $file.<\/p>","upvoteCount":3,"answerCount":7,"datePublished":"2018-02-14T13:11:19.000Z","author":{"@type":"Person","name":"ryanstanford2","url":"https://community.spiceworks.com/u/ryanstanford2"},"suggestedAnswer":[{"@type":"Answer","text":"
Good Morning/Afternoon/Evening<\/p>\n
I’m having an issue where my script is almost working too well.<\/p>\n
I need a column of dates in .csv files to be in format yyyyMMdd. This works fine, except for when that data is already in yyyyMMdd format, at which point it turns blank.<\/p>\n
I’m not sure how to have my script check if the date is in format already, and skip if it is. What I have right now is as follows:<\/p>\n
$Properties is an array of the column headers for the $file.<\/p>","upvoteCount":3,"datePublished":"2018-02-14T13:11:19.000Z","url":"https://community.spiceworks.com/t/powershell-get-date-format/634834/1","author":{"@type":"Person","name":"ryanstanford2","url":"https://community.spiceworks.com/u/ryanstanford2"}},{"@type":"Answer","text":"