I want to convert a C# DateTime to \"YYYYMMDDHHMMSS\" format. But I don\'t find a built in method to get this format? Any comments?
It is not a big deal. you can simply put like this
WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd-HH:mm:ss")}");
Excuse here for I used $ which is for string Interpolation .