ToReversedDateTime
internal static string ToReversedDateTime(this DateTime value) { return string.Format("{0:u}", value); }Example:
string reversed = DateTime.Now.ToReversedDateTime();
Description
Takes a DateTime object and reverses it to an SQL type string (yyyy-mm-dd hh:MM:ss)
Details
- Author: Jon Preece
- Submitted on: 25-10-2010 00:58:29
- Language: C#
- Type: System.String
- Views: 2226
Double click on the code to select all.