How to change the date format of NotAfter and NotBefore in Certificate

Hi guys, 

I need to change the date format of NotAfter and NotBefore to "MMMM/d/yyyy HH:MM:SS". Is this possible? 

Thank you!

Parents
No Data
Reply
  • If those properties are [datetime] datatype it is very easy. Note uppercase M in format is month, lowercase m in format is minutes.

    $NotBefore = Get-Date -Date 'July 1, 2021 13:45'
    Get-Date $NotBefore -Format 'MMMM/d/yyyy HH:mm:ss'
    July/1/2021 13:45:00
Children
No Data