I have this in my code:
var date1 = DateTime.ParseExact(date, "dd.MM.yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
And when my current cultur is dutch (nl-NL
) instead of May 1st I get January 5th.
I think the error is in the second parameter dd.MM.yyyy HH:mm:ss
.
Is there a way to fix this using the CultureInfo
class?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…