How can we obtain date time format in yyyy.MM.dd [duplicate]

Simply by using

string date = DateTime.Now.ToString("yyyy.MM.dd");

See this documentation for more info on custom date and time formats.

Leave a Comment