mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 19:19:57 +00:00
TUN-3375: Upgrade coredns and prometheus dependencies
This commit is contained in:
9
vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go
generated
vendored
9
vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go
generated
vendored
@@ -27,8 +27,8 @@ const (
|
||||
// RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z
|
||||
ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z"
|
||||
|
||||
// This format is used for output time without seconds precision
|
||||
ISO8601OutputTimeFormat = "2006-01-02T15:04:05Z"
|
||||
// This format is used for output time with fractional second precision up to milliseconds
|
||||
ISO8601OutputTimeFormat = "2006-01-02T15:04:05.999999999Z"
|
||||
)
|
||||
|
||||
// IsKnownTimestampFormat returns if the timestamp format name
|
||||
@@ -48,7 +48,7 @@ func IsKnownTimestampFormat(name string) bool {
|
||||
|
||||
// FormatTime returns a string value of the time.
|
||||
func FormatTime(name string, t time.Time) string {
|
||||
t = t.UTC()
|
||||
t = t.UTC().Truncate(time.Millisecond)
|
||||
|
||||
switch name {
|
||||
case RFC822TimeFormatName:
|
||||
@@ -56,7 +56,8 @@ func FormatTime(name string, t time.Time) string {
|
||||
case ISO8601TimeFormatName:
|
||||
return t.Format(ISO8601OutputTimeFormat)
|
||||
case UnixTimeFormatName:
|
||||
return strconv.FormatInt(t.Unix(), 10)
|
||||
ms := t.UnixNano() / int64(time.Millisecond)
|
||||
return strconv.FormatFloat(float64(ms)/1e3, 'f', -1, 64)
|
||||
default:
|
||||
panic("unknown timestamp format name, " + name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user