ext/xlsxwriter/libxlsxwriter/src/core.c in xlsxwriter-0.0.3 vs ext/xlsxwriter/libxlsxwriter/src/core.c in xlsxwriter-0.0.4.pre.2

- old
+ new

@@ -51,21 +51,21 @@ /* * Convert a time_t struct to a ISO 8601 style "2010-01-01T00:00:00Z" date. */ static void -_localtime_to_iso8601_date(time_t *timer, char *str, size_t size) +_datetime_to_iso8601_date(time_t *timer, char *str, size_t size) { - struct tm *tmp_localtime; + struct tm *tmp_datetime; time_t current_time = time(NULL); if (*timer) - tmp_localtime = localtime(timer); + tmp_datetime = gmtime(timer); else - tmp_localtime = localtime(&current_time); + tmp_datetime = gmtime(&current_time); - strftime(str, size - 1, "%Y-%m-%dT%H:%M:%SZ", tmp_localtime); + strftime(str, size - 1, "%Y-%m-%dT%H:%M:%SZ", tmp_datetime); } /***************************************************************************** * * XML functions. @@ -142,12 +142,12 @@ { struct xml_attribute_list attributes; struct xml_attribute *attribute; char datetime[LXW_ATTR_32]; - _localtime_to_iso8601_date(&self->properties->created, datetime, - LXW_ATTR_32); + _datetime_to_iso8601_date(&self->properties->created, datetime, + LXW_ATTR_32); LXW_INIT_ATTRIBUTES(); LXW_PUSH_ATTRIBUTES_STR("xsi:type", "dcterms:W3CDTF"); lxw_xml_data_element(self->file, "dcterms:created", datetime, @@ -164,11 +164,11 @@ { struct xml_attribute_list attributes; struct xml_attribute *attribute; char datetime[LXW_ATTR_32]; - _localtime_to_iso8601_date(&self->properties->created, datetime, - LXW_ATTR_32); + _datetime_to_iso8601_date(&self->properties->created, datetime, + LXW_ATTR_32); LXW_INIT_ATTRIBUTES(); LXW_PUSH_ATTRIBUTES_STR("xsi:type", "dcterms:W3CDTF"); lxw_xml_data_element(self->file, "dcterms:modified", datetime,