From 8489612dadd3775ffbba029a583b6f00e91d0547 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Tue, 12 Dec 2017 14:32:28 -0800 Subject: [PATCH 1/2] Update comments for Timestamp JSON format. Clarify that JSON parser are required to accept both UTC and other timezone offsets. Fixes issue 3093 --- src/google/protobuf/timestamp.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/timestamp.proto b/src/google/protobuf/timestamp.proto index 6074b1f719..eafb3fa03a 100644 --- a/src/google/protobuf/timestamp.proto +++ b/src/google/protobuf/timestamp.proto @@ -103,7 +103,9 @@ option objc_class_prefix = "GPB"; // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required, though only UTC (as indicated by "Z") is presently supported. +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. From 75eceb84249cd157dc26af44bb77edb57476c053 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Tue, 12 Dec 2017 14:57:34 -0800 Subject: [PATCH 2/2] Update generated code. --- csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs | 4 +++- objectivec/google/protobuf/Timestamp.pbobjc.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs index 036be63f9d..332d74b60a 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs @@ -101,7 +101,9 @@ namespace Google.Protobuf.WellKnownTypes { /// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional /// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), /// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - /// is required, though only UTC (as indicated by "Z") is presently supported. + /// is required. A proto3 JSON serializer should always use UTC (as indicated by + /// "Z") when printing the Timestamp type and a proto3 JSON parser should be + /// able to accept both UTC and other timezones (as indicated by an offset). /// /// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past /// 01:30 UTC on January 15, 2017. diff --git a/objectivec/google/protobuf/Timestamp.pbobjc.h b/objectivec/google/protobuf/Timestamp.pbobjc.h index 998bc15dd4..7e65b15bac 100644 --- a/objectivec/google/protobuf/Timestamp.pbobjc.h +++ b/objectivec/google/protobuf/Timestamp.pbobjc.h @@ -115,7 +115,9 @@ typedef GPB_ENUM(GPBTimestamp_FieldNumber) { * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required, though only UTC (as indicated by "Z") is presently supported. + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). * * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past * 01:30 UTC on January 15, 2017.