File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2062,6 +2062,23 @@ double("3.14") // 3.14 (if successful, otherwise an error)
20622062
20632063** duration**
20642064
2065+ Type conversion for duration values.
2066+
2067+ Note, duration strings should support the following suffixes:
2068+
2069+ * "h" (hour)
2070+ * "m" (minute)
2071+ * "s" (second)
2072+ * "ms" (millisecond)
2073+ * "us" (microsecond)
2074+ * "ns" (nanosecond)
2075+
2076+ Duration strings may be zero (` "0" ` ), negative (` -1h ` ), fractional (` -23.4s ` ),
2077+ and/or compound (` 1h34us ` ). Durations greater than the hour granularity, such
2078+ as days or weeks, are not supported as this would necessitate an understanding
2079+ of the locale of the execution context to account for leap seconds and leap
2080+ years.
2081+
20652082** Signatures:**
20662083
20672084* ` duration(google.protobuf.Duration) -> google.protobuf.Duration `
@@ -2071,6 +2088,8 @@ double("3.14") // 3.14 (if successful, otherwise an error)
20712088
20722089```
20732090duration("1h30m") // google.protobuf.Duration representing 1 hour and 30 minutes
2091+ duration("0") // zero duration value
2092+ duration("-1.5h") // minus 90 minutes
20742093```
20752094
20762095** dyn** ` type(dyn) ` \- Type denotation
You can’t perform that action at this time.
0 commit comments