Culture-insensitive date/time format strings

Format stringMeaning
oRound-trippable
r, RRFC 1123 standard
sSortable; ISO 8601
u"Universal" Sortable
UUTC

using System;
using System.Text;
using System.Globalization;
class Sample
{
    public static void Main()
    {
        DateTime dt = new DateTime(2000, 1, 2, 17, 18, 19);
        Console.WriteLine("{0:U}", dt);
    }
}

The output:


Monday, January 03, 2000 1:18:19 AM
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.