Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Sortable ("s") Format Specifier in C#
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
Advertisements
