private void SetEndTime(long newEndTime) { // Set end time of userflow in ticks. DateTime end_date = (new DateTime(newEndTime, DateTimeKind.Utc)); endTimeString = TimeUtils.ISO8601DateString(end_date); endTime = newEndTime; }
private void SetBeginTime(long newBeginTime) { // Set begin time of userflow in ticks. DateTime begin_date = (new DateTime(newBeginTime, DateTimeKind.Utc)); beginTimeString = TimeUtils.ISO8601DateString(begin_date); beginTime = newBeginTime; }
private void SetForegroundTime(long newForegroundTime) { // "Foreground time" == the latest Crittercism Init // time or foreground time, whichever is later, in ticks. DateTime foreground_date = (new DateTime(newForegroundTime, DateTimeKind.Utc)); foregroundTimeString = TimeUtils.ISO8601DateString(foreground_date); foregroundTime = newForegroundTime; }
internal static string JsonDateToISO8601DateString(JToken json) { // json that IsJsonDate converted to ISO8601DateString . string answer = ""; switch (json.Type) { case JTokenType.Date: answer = TimeUtils.ISO8601DateString((DateTime)((JValue)json).Value); break; case JTokenType.String: // Assume json was already an ISO8601DateString answer = (string)((JValue)json).Value; break; } return(answer); }
// Device State Array private static Object[] DeviceStateArray() { // [ // <report_timestamp>, // <carrier>, // <model>, // <cr_platform>, // <os_version>, // <mobile_country_code>, // optional // <mobile_network_code> // optional // ] Object[] answer = new Object[] { TimeUtils.ISO8601DateString(DateTime.UtcNow), Crittercism.Carrier, Crittercism.DeviceModel, Crittercism.OSName, Crittercism.OSVersion }; return(answer); }