aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/lib/pq/encode.go
diff options
context:
space:
mode:
authorGibheer <gibheer+git@zero-knowledge.org>2022-11-11 11:22:50 +0100
committerGibheer <gibheer+git@zero-knowledge.org>2022-11-11 11:22:50 +0100
commitfe6bd04947e26a962fab3cf7a354abd44333bda6 (patch)
treede4714364747c05d391ab665176413eb24938545 /vendor/github.com/lib/pq/encode.go
parentdc9dfb76ff9375e6368e9e05a40e6dc07b325a8d (diff)
update dependencies
Diffstat (limited to 'vendor/github.com/lib/pq/encode.go')
-rw-r--r--vendor/github.com/lib/pq/encode.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/github.com/lib/pq/encode.go b/vendor/github.com/lib/pq/encode.go
index 210b1ec..bffe609 100644
--- a/vendor/github.com/lib/pq/encode.go
+++ b/vendor/github.com/lib/pq/encode.go
@@ -422,7 +422,7 @@ func ParseTimestamp(currentLocation *time.Location, str string) (time.Time, erro
if remainderIdx < len(str) && str[remainderIdx] == '.' {
fracStart := remainderIdx + 1
- fracOff := strings.IndexAny(str[fracStart:], "-+ ")
+ fracOff := strings.IndexAny(str[fracStart:], "-+Z ")
if fracOff < 0 {
fracOff = len(str) - fracStart
}
@@ -432,7 +432,7 @@ func ParseTimestamp(currentLocation *time.Location, str string) (time.Time, erro
remainderIdx += fracOff + 1
}
if tzStart := remainderIdx; tzStart < len(str) && (str[tzStart] == '-' || str[tzStart] == '+') {
- // time zone separator is always '-' or '+' (UTC is +00)
+ // time zone separator is always '-' or '+' or 'Z' (UTC is +00)
var tzSign int
switch c := str[tzStart]; c {
case '-':
@@ -454,7 +454,11 @@ func ParseTimestamp(currentLocation *time.Location, str string) (time.Time, erro
remainderIdx += 3
}
tzOff = tzSign * ((tzHours * 60 * 60) + (tzMin * 60) + tzSec)
+ } else if tzStart < len(str) && str[tzStart] == 'Z' {
+ // time zone Z separator indicates UTC is +00
+ remainderIdx += 1
}
+
var isoYear int
if isBC {