public void SetSecondsWorks() { var dt = new JsDate(2000, 0, 1); dt.SetSeconds(23); Assert.AreEqual(dt.GetSeconds(), 23); }
public static JsDate RoundToMinutes(JsDate date, int minutesStep) { date = new JsDate(date.GetTime()); var m = (int)(Math.Round((double)date.GetMinutes() / minutesStep) * minutesStep); date.SetMinutes(m); date.SetSeconds(0); date.SetMilliseconds(0); return(date); }