public static Date round(Date date, Resolution resolution) {return new Date(round(date.getTime(), resolution));}
public static DateTime Round(DateTime date, Resolution resolution){return new DateTime(Round(date.Ticks / TimeSpan.TicksPerMillisecond, resolution));}