Example #1
0
 /// <summary>
 /// Merge a DateTime with a Time
 /// </summary>
 /// <param name="dateTime">The DateTime to merge in to</param>
 /// <param name="time">The Time to merge in to the DateTime</param>
 /// <returns>Te new DateTime merged with the Time</returns>
 public static DateTime Merge(this DateTime dateTime, Time time) => (dateTime.Date + time.ToTimeSpan());
Example #2
0
 /// <summary>
 /// Set the time for a DateTime from a Time
 /// </summary>
 /// <param name="dateTime">The DateTime for which to set the time</param>
 /// <param name="time">The Time from which the time is set</param>
 /// <returns>The new DateTime with the time set</returns>
 public static DateTime SetTime(this DateTime dateTime, Time time) => dateTime.SetTime(time.Hour, time.Minute, time.Second);