From: Ian Lance Taylor Date: Thu, 27 Jan 2022 00:19:47 +0000 (-0800) Subject: time: document that Parse truncates to nanosecond precision X-Git-Tag: go1.18rc1~7 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=293ecd87c10eb5eed777d220394ed63a935b2c20;p=gostls13.git time: document that Parse truncates to nanosecond precision For #48685 Fixes #50806 Change-Id: Ie8be40e5794c0998538890a651ef8ec92cb72d3a Reviewed-on: https://go-review.googlesource.com/c/go/+/381155 Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Paul Jolly Reviewed-by: Michael Knyszek --- diff --git a/src/time/format.go b/src/time/format.go index 5fb9cdc969..33e6543289 100644 --- a/src/time/format.go +++ b/src/time/format.go @@ -914,6 +914,7 @@ func skip(value, prefix string) (string, error) { // field immediately after the seconds field, even if the layout does not // signify its presence. In that case either a comma or a decimal point // followed by a maximal series of digits is parsed as a fractional second. +// Fractional seconds are truncated to nanosecond precision. // // Elements omitted from the layout are assumed to be zero or, when // zero is impossible, one, so parsing "3:04pm" returns the time