summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/save-xml.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/save-xml.c b/core/save-xml.c
index 84530a749..df6b99eb1 100644
--- a/core/save-xml.c
+++ b/core/save-xml.c
@@ -354,8 +354,9 @@ static void show_date(struct membuffer *b, timestamp_t when)
put_format(b, " date='%04u-%02u-%02u'",
tm.tm_year, tm.tm_mon + 1, tm.tm_mday);
- put_format(b, " time='%02u:%02u:%02u'",
- tm.tm_hour, tm.tm_min, tm.tm_sec);
+ if (tm.tm_hour || tm.tm_min || tm.tm_sec)
+ put_format(b, " time='%02u:%02u:%02u'",
+ tm.tm_hour, tm.tm_min, tm.tm_sec);
}
static void save_samples(struct membuffer *b, struct dive *dive, struct divecomputer *dc)