From: <svn...@op...> - 2010-08-13 22:47:54
|
Author: cdfrey Date: Sat Aug 14 00:47:44 2010 New Revision: 6076 URL: http://www.opensync.org/changeset/6076 Log: time: put UTC detection in one function only Modified: trunk/opensync/format/opensync_time.c Modified: trunk/opensync/format/opensync_time.c ============================================================================== --- trunk/opensync/format/opensync_time.c Sat Jul 10 05:49:35 2010 (r6075) +++ trunk/opensync/format/opensync_time.c Sat Aug 14 00:47:44 2010 (r6076) @@ -139,6 +139,8 @@ osync_bool osync_time_isutc(const char *vtime) { + // use strstr() here so that if there are milliseconds in the + // timestamp, the Z still gets found if (!strstr(vtime, "Z")) return FALSE; @@ -542,7 +544,7 @@ struct tm *tm_local = NULL, *tm_utc = NULL; osync_trace(TRACE_ENTRY, "%s(%s,%i)", __func__, localtime, offset); - if (strstr(localtime, "Z")) { + if (osync_time_isutc(localtime)) { utc = g_strdup(localtime); goto end; } @@ -582,7 +584,7 @@ struct tm *tm_local = NULL, *tm_utc = NULL; osync_trace(TRACE_ENTRY, "%s(%s,%i)", __func__, utc, offset); - if (!strstr(utc, "Z")) { + if (!osync_time_isutc(utc)) { localtime = g_strdup(utc); return localtime; } |