Пример #1
0
        /// <summary>
        /// get date by culture
        /// </summary>
        /// <param name="format as MM or dd or yyyy"></param>
        /// <param name="date as date object"></param>
        /// <returns></returns>
        public static string GetDateByCulture(string format, DateTime date)
        {
            switch (XMLService.ReadInXmlFile("DateLanguage"))
            {
            case "ar":
                return(date.ToString(format, new CultureInfo("ar")));

            default:
                return(date.ToString(format, new CultureInfo("en")));
            }
        }
Пример #2
0
        public static string GetDateTimeByCulture(DateTime date)
        {
            string Format = "dd/MM/yyyy hh:mm:ss tt";

            switch (XMLService.ReadInXmlFile("DateLanguage"))
            {
            case "ar":
                return(date.ToString(Format, new CultureInfo("ar")));

            default:
                return(date.ToString(Format, new CultureInfo("en")));
            }
        }