CSharp examples for System:DateTime Calculate
Change Time of DateTime
using System.Collections.Generic; using System;/*from w ww. ja v a 2 s .co m*/ public class Main{ public static DateTime ChangeTime(this DateTime dateTime, int hours, int minutes, int seconds, int milliseconds) { return new DateTime( dateTime.Year, dateTime.Month, dateTime.Day, hours, minutes, seconds, milliseconds, dateTime.Kind); } }