Esempio n. 1
0
        public static string ConvertDateFormat(string DateValue, DATE_FORMAT Format)
        {
            System.DateTime sDate = new System.DateTime();
            string          DateRet;

            if (DateValue == string.Empty)
            {
                DateValue = "01/01/2000";
            }

            sDate = DateTime.Parse(DateValue);
            switch (Format)
            {
            case DATE_FORMAT.DDMMYYYY:
                DateRet = sDate.Day.ToString() + "/" + sDate.Month.ToString() + "/" + sDate.Year.ToString();
                break;

            case DATE_FORMAT.YYYYMMDD:
                DateRet = sDate.Year.ToString() + "-" + sDate.Month.ToString() + "-" + sDate.Day.ToString();
                break;

            default:
                DateRet = sDate.Year.ToString() + "-" + sDate.Month.ToString() + "-" + sDate.Day.ToString();
                break;
            }

            return(DateRet);
        }
Esempio n. 2
0
 public static extern int GetDateFormat(uint Locale, DATE_FORMAT dwFlags, in SYSTEMTIME lpDate, string lpFormat, StringBuilder lpDateStr, int cchDate);
Esempio n. 3
0
 public static extern void ConvertStdTimeToDateFormat(Int32 stdTm, ref DATE_FORMAT dft, bool znFlag = false);
Esempio n. 4
0
 public void ConvertStdTimeToDateFormatEx(Int32 stdTm, ref DATE_FORMAT dft, bool znFlag = false)
 {
     ConvertStdTimeToDateFormat(stdTm, ref dft, znFlag);
 }
Esempio n. 5
0
 get => this.BirthDate?.ToString(DATE_FORMAT, CultureInfo.InvariantCulture.DateTimeFormat);
Esempio n. 6
0
 public static extern int GetDateFormatEx(string lpLocaleName, DATE_FORMAT dwFlags, [In] ref SYSTEMTIME lpDate, [In] string lpFormat, [Out] StringBuilder lpDateStr, int cchDate);