When you parse your string to DateTime, it will have no format.
DateTime structure does not have any implicit format. It just have date and time values which is based on long field as Ticks
. Format concept only applies when you try to get it's textual (aka string) representation of it. It is really important to understand the difference between a DateTime instance and it's formatted string representation.
So, if you wanna get a specific textual format of your DateTime, you will need to get it's string representation again.
string result = myDate.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…