- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
private void SetTime(DateTime DateAndTime)
        {
            if (SelectedTimeFormat == TimeFormat.Twelve)
            {
                Hour = Convert.ToInt32(DateAndTime.ToString("hh", DateTimeFormatInfo.InvariantInfo));
                AmPm = (DateAndTime.ToString("tt", DateTimeFormatInfo.InvariantInfo) == "AM")
                           ? AmPmSpec.AM
                           : AmPmSpec.PM;
            }
            else
            {
                Hour = Convert.ToInt32(DateAndTime.ToString("HH", DateTimeFormatInfo.InvariantInfo));
            }
            Minute = Convert.ToInt32(DateAndTime.ToString("mm", DateTimeFormatInfo.InvariantInfo));
            Second = AllowSecondEditing
                         ? Convert.ToInt32(DateAndTime.ToString("ss", DateTimeFormatInfo.InvariantInfo))
                         : 0;
            string str = (Minute.ToString().Length == 1) ? ("0" + Minute) : Minute.ToString();
            ViewState["Date"] = Convert.ToDateTime(ViewState["Date"]).ToShortDateString() + " " + Hour + ":" + str +
                                ":00 " + AmPm;
        }
                                 
        
Комментарии (0) RSS
Добавить комментарий