diff options
| -rw-r--r-- | src/xplist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xplist.c b/src/xplist.c index 653cf49..405a844 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -223,7 +223,7 @@ static void node_to_xml(node_t* node, void *xml_struct) | |||
| 223 | tag = XPLIST_DATE; | 223 | tag = XPLIST_DATE; |
| 224 | { | 224 | { |
| 225 | time_t time = (time_t)node_data->timeval.tv_sec; | 225 | time_t time = (time_t)node_data->timeval.tv_sec; |
| 226 | struct tm *btime = localtime(&time); | 226 | struct tm *btime = gmtime(&time); |
| 227 | if (btime) { | 227 | if (btime) { |
| 228 | val = (char*)malloc(24); | 228 | val = (char*)malloc(24); |
| 229 | memset(val, 0, 24); | 229 | memset(val, 0, 24); |
| @@ -398,8 +398,11 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node) | |||
| 398 | time_t time = 0; | 398 | time_t time = 0; |
| 399 | if (strlen((const char*)strval) >= 11) { | 399 | if (strlen((const char*)strval) >= 11) { |
| 400 | struct tm btime; | 400 | struct tm btime; |
| 401 | struct tm* tm_utc; | ||
| 401 | parse_date((const char*)strval, &btime); | 402 | parse_date((const char*)strval, &btime); |
| 402 | time = mktime(&btime); | 403 | time = mktime(&btime); |
| 404 | tm_utc = gmtime(&time); | ||
| 405 | time -= (mktime(tm_utc) - time); | ||
| 403 | } | 406 | } |
| 404 | data->timeval.tv_sec = (long)time; | 407 | data->timeval.tv_sec = (long)time; |
| 405 | data->timeval.tv_usec = 0; | 408 | data->timeval.tv_usec = 0; |
