The Sortable standard format specifier represents a custom date and time format string.
The format string is defined by the DateTimeFormatInfo.SortableDateTimePattern property.
The custom format string.
yyyy'-'MM'-'dd'T'HH':'mm':'ss
Example
using System;
class Demo {
static void Main() {
DateTime date = new DateTime(2018, 9, 5, 2, 12, 40);
Console.WriteLine(date.ToString("s"));
}
}Output
2018-09-05T02:12:40