Fix LocalTime time zone offset format.
ISO8601 defines basic datetime format YYYYMMDDThhmmss+hhmm and extended format
YYYY-MM-DDThh:mm:ss+hh:mm. The current PrintableLocalTime is a mix of both.
This also makes the format satisfy the stricter RFC3339.
There is no test because it depends on the local time zone.
@@ -99,7 +99,7 @@ namespace {
template <bool PrintUpToSeconds>
void WritePrintableLocalTimeToStream(IOutputStream& os, const ::NPrivate::TPrintableLocalTime<PrintUpToSeconds>& timeToPrint) {
- const auto& momentToPrint = timeToPrint.MomentToPrint;
+ const TInstant& momentToPrint = timeToPrint.MomentToPrint;
struct tm localTime;
momentToPrint.LocalTime(&localTime);
WriteTmToStream(os, localTime);
@@ -124,7 +124,7 @@ namespace {
} else {
os << '+';
}
- os << Pad<2>(utcOffsetInMinutes / 60) << Pad<2>(utcOffsetInMinutes % 60);
+ os << Pad<2>(utcOffsetInMinutes / 60) << ':' << Pad<2>(utcOffsetInMinutes % 60);
}
}
}
