private static long ToUniversalTicks(DateTime dateTime) { if (dateTime.Kind == DateTimeKind.Utc) { return(dateTime.Ticks); } return(DateTimeUtils.ToUniversalTicks(dateTime, dateTime.GetUtcOffset())); }
internal static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime, bool convertToUtc) { long universialTicks = convertToUtc ? DateTimeUtils.ToUniversalTicks(dateTime) : dateTime.Ticks; return(DateTimeUtils.UniversialTicksToJavaScriptTicks(universialTicks)); }
internal static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime, TimeSpan offset) { long universialTicks = DateTimeUtils.ToUniversalTicks(dateTime, offset); return(DateTimeUtils.UniversialTicksToJavaScriptTicks(universialTicks)); }