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

            return(JsonConvert.UniversialTicksToJavaScriptTicks(universialTicks));
        }