From 44fea6c8c2cd673a2c72338f60a557a3f60257ae Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 26 Apr 2020 21:45:20 +0200 Subject: [PATCH] Omit default components when formatting date time It just looks nicer to have e.g. "2017" instead of "2017-01-01T00:00:00". The ID3v2.4.0 standard and the Matroska standard explicitely allow this format as well. --- tagvalue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tagvalue.cpp b/tagvalue.cpp index 034ca8a..3abaf05 100644 --- a/tagvalue.cpp +++ b/tagvalue.cpp @@ -667,7 +667,7 @@ void TagValue::toString(string &result, TagTextEncoding encoding) const result = toTimeSpan().toString(); break; case TagDataType::DateTime: - result = toDateTime().toIsoString(); + result = toDateTime().toString(DateTimeOutputFormat::IsoOmittingDefaultComponents); break; default: throw ConversionException(argsToString("Can not convert ", tagDataTypeString(m_type), " to string."));