Set Time - CSharp System

CSharp examples for System:DateTime Time

Description

Set Time

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from www. j  a v a2s. c om*/

public class Main{
        public static DateTime SetTime(this DateTime dt, int hour, int minute)
        {
            return new DateTime(dt.Year, dt.Month, dt.Day, hour, minute, 0);
        }
}

Related Tutorials