To Iso 8601 DateTime Format - CSharp System

CSharp examples for System:DateTime Format

Description

To Iso 8601 DateTime Format

Demo Code


using System;//  ww w.ja v  a 2  s .c  om

public class Main{
        public static string ToIso8601(this DateTimeOffset dateTimeOffset)
        {
            return dateTimeOffset.ToString("O");
        }
        public static string ToIso8601(this DateTime dateTime)
        {
            return dateTime.ToString("O");
        }
}

Related Tutorials