diff options
-rw-r--r-- | src/common/media-svc-util.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/media-svc-util.c b/src/common/media-svc-util.c index 2da5c75..84c54cc 100644 --- a/src/common/media-svc-util.c +++ b/src/common/media-svc-util.c @@ -318,14 +318,15 @@ static time_t __media_svc_get_timeline_from_str(const char *timstr) /* If time string has timezone */ if (strptime(timstr, "%Y:%m:%d %H:%M:%S %z", &t) || strptime(timstr, "%Y-%m-%d %H:%M:%S %z", &t)) { - GTimeVal timeval; char tim_tmp_str[255] = { 0, }; /* ISO8601 Time string format */ strftime(tim_tmp_str, 255, "%Y-%m-%dT%H:%M:%S%z", &t); - g_time_val_from_iso8601(tim_tmp_str, &timeval); - modified_t = timeval.tv_sec; - media_svc_debug("Calibrated timeval : [%lu][%s]", modified_t, tim_tmp_str); + GDateTime *pdatetime = g_date_time_new_from_iso8601(tim_tmp_str, NULL); + if (pdatetime) + modified_t = g_date_time_to_unix(pdatetime); + g_date_time_unref(pdatetime); + media_svc_debug("Calibrated timeval : [%ld][%s]", modified_t, tim_tmp_str); } else { /* Just localtime */ modified_t = mktime(&t); |