c# convert date to string format mm/dd/yyyy code example
Example 1: c# date to string yyyy-mm-dd
var date_string = date.ToString("yyyy-MM-dd");
Example 2: sql convert date to string yyyy-mm-dd
select CONVERT(char(10), GetDate(),126)
/* 2020-12-23 */