Ejemplo n.º 1
0
        public override DateTime ToTime()
        {
            int years   = (int)year.ToYear();
            int months  = (int)month;
            int days    = (int)day.ToDay();
            int hours   = (int)clock.ToHour();
            int minutes = (int)clock.ToMinute();
            int seconds = (int)clock.ToSecond();

            TimeValidator.ValidateDate(days, months, years);
            TimeValidator.ValidateClock(hours, minutes, seconds);

            return(new DateTime(years, months, days, hours, minutes, seconds));
        }
Ejemplo n.º 2
0
        public override DateTime ToTime()
        {
            DateTime dtime = time.ToTime();

            int hours   = (int)clock.ToHour();
            int minutes = (int)clock.ToMinute();
            int seconds = (int)clock.ToSecond();

            TimeValidator.ValidateClock(hours, minutes, seconds);

            TimeSpan ts = new TimeSpan(hours, minutes, seconds);

            dtime = dtime.Date + ts;

            return(dtime);
        }