convert datetime to yyyy-mm-dd date format in c# code example Example: c# datetime format ymd Use DateTime.Now.ToString("yyyy-MM-dd h:mm tt");