Rock.ExtensionMethods.ToMonthDayString C# (CSharp) Méthode

ToMonthDayString() public static méthode

Converts the date to a string containing month and day values ( culture-specific ).
public static ToMonthDayString ( this dateTime ) : string
dateTime this The date time.
Résultat string
        public static string ToMonthDayString( this DateTime dateTime )
        {
            var dtf = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat;
            string mdp = dtf.ShortDatePattern;
            mdp = mdp.Replace( dtf.DateSeparator + "yyyy", "" ).Replace( "yyyy" + dtf.DateSeparator, "" );
            return dateTime.ToString( mdp );
        }