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)); }
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); }