I am working with DateTime, trying to get date in the format like this:
03.05.2010-04.05.23
that is: dd.MM.yyyy-HH.mm.ss
I'm using DateTime.ParseExact
to try to achieve this (maybe wrong)
So far I have:
var dateInFormat = DateTime.ParseExact(DateTime.Now.ToShortDateString(), "dd.MM.yyyy.HH.mm.ss", null);
But can't quite get exactly what I want. Basically I want to keep the 0, for example time is 05:03:20 PM I don't want it to show like 5:3:20 PM
Any ideas?