Set Time to DateTime - CSharp System

CSharp examples for System:DateTime Time

Description

Set Time to DateTime

Demo Code


using System.Globalization;
using System.Collections.Generic;
using System;//from w w w . j a va2 s .c  o  m

public class Main{
        public static DateTime SetTime(this DateTime src, int hours, int mins, int seconds)
        {
            return new DateTime(src.Year, src.Month, src.Day, hours, mins, seconds, src.Kind);
        }
}

Related Tutorials