Rohan Ramani

Rohan Ramani

  • NA
  • 786
  • 145.9k

How to set Date Time format in 24 hours in c#?

Dec 3 2019 2:28 AM
Hello,
I have to set date time format in 24 hours.
  1. DateTime dtDeadline = (DateTime)currentResume.PositionDeadlineTime;  
  2. dateDeadLine = dtDeadline.ToString("dd MMM yyyy hh:mm:ss");  
This will give the results as "03 Dec 2019 01:30:00"  // 12 hours
But I need the results as "03 Dec 2019 13:30:00"   // 24 hours

Answers (1)