System.Globalization.DateTimeFormatInfo.GetDayName C# (CSharp) Méthode

GetDayName() public méthode

Returns the culture-specific full name of the specified day of the week based on the culture associated with the current DateTimeFormatInfo object.
public GetDayName ( DayOfWeek dayofweek ) : string
dayofweek DayOfWeek A System.DayOfWeek value.
Résultat string
        public extern string GetDayName(DayOfWeek dayofweek);

Usage Example

        public static String DateTimeAFechaCortaConDiaMesTexto(DateTime fecha)
        {
            System.Globalization.DateTimeFormatInfo mfi = Thread.CurrentThread.CurrentUICulture.DateTimeFormat;
            string DiaSemana = mfi.GetDayName(fecha.DayOfWeek);
            string Mes       = mfi.GetAbbreviatedMonthName(fecha.Month).Replace(".", "");

            String fechaSt = DiaSemana.Substring(0, 3) + "," + IntANDigitos(fecha.Day, 2) + @"" + Mes + @"'" + fecha.Year.ToString().Substring(2, 2);

            return(fechaSt);
        }
All Usage Examples Of System.Globalization.DateTimeFormatInfo::GetDayName