Home > Back-end >  How can I change DateTime to am and pm instead of AM/PM for C#
How can I change DateTime to am and pm instead of AM/PM for C#

Time:10-13

Here is the code I am using below

    string Time = DateTime.Now.ToString("MM/dd/yy h:mm tt");

The above tt will give me AM or PM but I need am or pm. Is there a different way to write this to get am or pm in C#? I have tried TT,t leaving it out completely but all end in failure.

CodePudding user response:

DateTime.Now.ToString("MM/dd/yy h:mm tt").ToLower();
  • Related