Jeffrey Renfroe
asked on
Formatting a date/time with PowerShell
I have a date/time like the below. I have tried different methods but cannot get it formatted properly. Can someone point me in the right direction?
Current Format
20160801164123.157000+000
Desired Format
yyyyMMdd HH:mm:ss
Current Format
20160801164123.157000+000
Desired Format
yyyyMMdd HH:mm:ss
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for the assistance. This was helpful.
ASKER
Thank you aikimark for the assistance as well.
How important are the fractions of a second in your conversion? The fractional seconds are being ignored by the posted solution as well as this alternative solution.
Open in new window
Note: I find some of these methods rather verbose. I prefer something like this:
Open in new window