Hi,
i am trying to understand how DateTime.ToString(Date pattern) work in .net framework, C#.
I changed my computer to have a short Date format like this yyyy.MM.dd. Following is what I notice
DateTime myDate = DateTime.Now;
myDate.ToString("yyyy/MM/dd")
always return in the format of yyyy.MM.dd not yyyy/MM/dd
and
myDate.ToString("yyyy-MM-dd")
does return string in the format of yyyy-MM-dd
to have it return what i was looking for, this is what i need to do
myDate.ToString("yyyy'/'MM'/'dd")
===> yyyy/MM/dd
Can anyone explain to me why it is doing that? and is there any other way i can achieve the same result?
thanks....