I experiencing a strange behavior of C#. Its some thing like this..
var date = DateTime.Now.ToString('MM/dd/yyyy');
I expecting out to be
04/24/2009
but in actuall its returning
04-24-2009
and my OS culture is en-GB, I’m using .Net 3.5 and WPF
any solutions please… ???
According to the MSDN docs for custom date and time format strings,
/is a placeholder:If you want a definite slash, use ‘MM’/’dd’/’yyyy’: