github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/util/timeutil/timeutil.go (about) 1 // Copyright 2020 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package timeutil 12 13 // FullTimeFormat is the time format used to display any unknown timestamp 14 // type, and always shows the full time zone offset. 15 const FullTimeFormat = "2006-01-02 15:04:05.999999-07:00:00" 16 17 // TimestampWithTZFormat is the time format used to display 18 // timestamps with a time zone offset. The minutes and seconds 19 // offsets are only added if they are non-zero. 20 const TimestampWithTZFormat = "2006-01-02 15:04:05.999999-07" 21 22 // TimestampWithoutTZFormat is the time format used to display 23 // timestamps without a time zone offset. The minutes and seconds 24 // offsets are only added if they are non-zero. 25 const TimestampWithoutTZFormat = "2006-01-02 15:04:05.999999" 26 27 // TimeWithTZFormat is the time format used to display a time 28 // with a time zone offset. 29 const TimeWithTZFormat = "15:04:05.999999-07" 30 31 // TimeWithoutTZFormat is the time format used to display a time 32 // without a time zone offset. 33 const TimeWithoutTZFormat = "15:04:05.999999" 34 35 // DateFormat is the time format used to display a date. 36 const DateFormat = "2006-01-02"