To Atom Feed Date - CSharp System

CSharp examples for System:DateTime Format

Description

To Atom Feed Date

Demo Code


using System;/*from  ww w  . j  a va  2 s .c  o  m*/

public class Main{
        public static string ToAtomFeedDate(this DateTime? dt)
        {
            return dt == null ? "" : ToAtomFeedDate(dt.Value);
        }
        public static string ToAtomFeedDate(this DateTime dt)
        {
            return string.Format("{0:yyyy-MM-ddTHH:mm:ssZ}", dt);
        }
}

Related Tutorials