]> granicus.if.org Git - sysstat/commitdiff
Change time format from HH-MM-SS to HH:MM:SS in the reports
authorSebastien Godard <sysstat@orange.fr>
Tue, 8 May 2012 12:25:52 +0000 (14:25 +0200)
committerSebastien Godard <sysstat@orange.fr>
Tue, 8 May 2012 12:25:52 +0000 (14:25 +0200)
displyaed by sadf.

Change the time format to HH:MM:SS to be consistent with XSD
document. This was already the format used a few versions ago
and was changed for an unknown reason.

Mail from Frank Glinka <glinkaf@uni-muenster.de> 24/04/2012:

Your sysstat.xsd specifies the type xs:time for the time elements within the XML. According to the schema specification the format then must be HH:MM:SS for the data but sadf's format is HH-MM-SS. Correspondingly, the element is not valid and not parsed by JAXB.

See:
http://www.w3.org/TR/xmlschema-2/#time
http://www.w3schools.com/schema/schema_dtypes_date.asp

CHANGES
sadf.c

diff --git a/CHANGES b/CHANGES
index 2e1ff3f69a29db8fde13979e5fb4afc55373951d..4ec78b4f8815f8cca8d604858ba47829c1730ab7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,8 @@ xxxx/xx/xx: Version 10.0.5 - Sebastien Godard (sysstat <at> orange.fr)
        * [Alain Chereau]: Options -g and -T added to iostat. These
          options enable the user to display statistics for groups of
          devices.
+       * sadf: Change time format from HH-MM-SS to HH:MM:SS in the
+         various reports displayed by sadf.
        * XSD document updated: Added a maxOccurs indicator for the
          timestamp element.
        * [Peter Schiffer]: Set exit code to 0 for sa2 shell script.
diff --git a/sadf.c b/sadf.c
index 1bc607cf7c418c1c377c4eb78c312ce19c7f479a..d6a2b76fc0fcb7d5170e52569f6dbced50982da1 100644 (file)
--- a/sadf.c
+++ b/sadf.c
@@ -250,7 +250,7 @@ void set_record_timestamp_string(int curr, char *cur_date, char *cur_time, int l
                 * cur_time is expressed in local time. Else it is expressed in UTC.
                 */
                strftime(cur_date, len, "%Y-%m-%d", rectime);
-               strftime(cur_time, len, "%H-%M-%S", rectime);
+               strftime(cur_time, len, "%H:%M:%S", rectime);
        }
 }