datetime format c# yyyy-mm-dd hh mm ss code example
Example 1: c# date to string yyyy-mm-dd
var date_string = date.ToString("yyyy-MM-dd");
Example 2: c# datetime dd/mm/yyy hh:mm:ss
DateTime.Now.ToString("dd'/'MM'/'yyyy HH:mm:ss")
//output: 13/06/2020 13:05:21