public void SetTimeWorks() { var dt = new JsDate(); dt.SetTime(3498302349234L); Assert.AreEqual(dt.GetTime(), 3498302349234L); }
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); }
public void GetTimeWorks() { var dt = new JsDate(JsDate.Utc(1970, 0, 2)); Assert.AreEqual(dt.GetTime(), 1440 * 60 * 1000); }