CSharp examples for System:DateTime Calculate
Round Down DateTime
using System.Configuration; using System;//from w ww . ja va2 s . c o m public class Main{ public static DateTime RoundDown(this DateTime dateTime, int minutes) { return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, (dateTime.Minute / minutes) * minutes, 0); } }