go1.20.5
GoThrough

time.ANSIC

// These are predefined layouts for use in Time.Format and time.Parse. // The reference time used in these layouts is the specific time stamp: // // 01/02 03:04:05PM '06 -0700 // // (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). // That value is recorded as the constant named Layout, listed below. As a Unix // time, this is 1136239445. Since MST is GMT-0700, the reference would be // printed by the Unix date command as: // // Mon Jan 2 15:04:05 MST 2006 // // It is a regrettable historic error that the date uses the American convention // of putting the numerical month before the day. // // The example for Time.Format demonstrates the working of the layout string // in detail and is a good reference. // // Note that the RFC822, RFC850, and RFC1123 formats should be applied // only to local times. Applying them to UTC times will use "UTC" as the // time zone abbreviation, while strictly speaking those RFCs require the // use of "GMT" in that case. // In general RFC1123Z should be used instead of RFC1123 for servers // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats // permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. // // Most programs can use one of the defined constants as the layout passed to // Format or Parse. The rest of this comment can be ignored unless you are // creating a custom layout string. // // To define your own format, write down what the reference time would look like // formatted your way; see the values of constants like ANSIC, StampMicro or // Kitchen for examples. The model is to demonstrate what the reference time // looks like so that the Format and Parse methods can apply the same // transformation to a general time value. // // Here is a summary of the components of a layout string. Each element shows by // example the formatting of an element of the reference time. Only these values // are recognized. Text in the layout string that is not recognized as part of // the reference time is echoed verbatim during Format and expected to appear // verbatim in the input to Parse. // // Year: "2006" "06" // Month: "Jan" "January" "01" "1" // Day of the week: "Mon" "Monday" // Day of the month: "2" "_2" "02" // Day of the year: "__2" "002" // Hour: "15" "3" "03" (PM or AM) // Minute: "4" "04" // Second: "5" "05" // AM/PM mark: "PM" // // Numeric time zone offsets format as follows: // // "-0700" ±hhmm // "-07:00" ±hh:mm // "-07" ±hh // "-070000" ±hhmmss // "-07:00:00" ±hh:mm:ss // // Replacing the sign in the format with a Z triggers // the ISO 8601 behavior of printing Z instead of an // offset for the UTC zone. Thus: // // "Z0700" Z or ±hhmm // "Z07:00" Z or ±hh:mm // "Z07" Z or ±hh // "Z070000" Z or ±hhmmss // "Z07:00:00" Z or ±hh:mm:ss // // Within the format string, the underscores in "_2" and "__2" represent spaces // that may be replaced by digits if the following number has multiple digits, // for compatibility with fixed-width Unix time formats. A leading zero represents // a zero-padded value. // // The formats __2 and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // // A comma or decimal point followed by one or more zeros represents // a fractional second, printed to the given number of decimal places. // A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with // millisecond precision. // // Some valid layouts are invalid time values for time.Parse, due to formats // such as _ for space padding and Z for zone information. const ANSIC = "Mon Jan _2 15:04:05 2006"

time.April

const April = iota

time.August

const August = iota

time.DateOnly

// These are predefined layouts for use in Time.Format and time.Parse. // The reference time used in these layouts is the specific time stamp: // // 01/02 03:04:05PM '06 -0700 // // (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). // That value is recorded as the constant named Layout, listed below. As a Unix // time, this is 1136239445. Since MST is GMT-0700, the reference would be // printed by the Unix date command as: // // Mon Jan 2 15:04:05 MST 2006 // // It is a regrettable historic error that the date uses the American convention // of putting the numerical month before the day. // // The example for Time.Format demonstrates the working of the layout string // in detail and is a good reference. // // Note that the RFC822, RFC850, and RFC1123 formats should be applied // only to local times. Applying them to UTC times will use "UTC" as the // time zone abbreviation, while strictly speaking those RFCs require the // use of "GMT" in that case. // In general RFC1123Z should be used instead of RFC1123 for servers // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats // permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. // // Most programs can use one of the defined constants as the layout passed to // Format or Parse. The rest of this comment can be ignored unless you are // creating a custom layout string. // // To define your own format, write down what the reference time would look like // formatted your way; see the values of constants like ANSIC, StampMicro or // Kitchen for examples. The model is to demonstrate what the reference time // looks like so that the Format and Parse methods can apply the same // transformation to a general time value. // // Here is a summary of the components of a layout string. Each element shows by // example the formatting of an element of the reference time. Only these values // are recognized. Text in the layout string that is not recognized as part of // the reference time is echoed verbatim during Format and expected to appear // verbatim in the input to Parse. // // Year: "2006" "06" // Month: "Jan" "January" "01" "1" // Day of the week: "Mon" "Monday" // Day of the month: "2" "_2" "02" // Day of the year: "__2" "002" // Hour: "15" "3" "03" (PM or AM) // Minute: "4" "04" // Second: "5" "05" // AM/PM mark: "PM" // // Numeric time zone offsets format as follows: // // "-0700" ±hhmm // "-07:00" ±hh:mm // "-07" ±hh // "-070000" ±hhmmss // "-07:00:00" ±hh:mm:ss // // Replacing the sign in the format with a Z triggers // the ISO 8601 behavior of printing Z instead of an // offset for the UTC zone. Thus: // // "Z0700" Z or ±hhmm // "Z07:00" Z or ±hh:mm // "Z07" Z or ±hh // "Z070000" Z or ±hhmmss // "Z07:00:00" Z or ±hh:mm:ss // // Within the format string, the underscores in "_2" and "__2" represent spaces // that may be replaced by digits if the following number has multiple digits, // for compatibility with fixed-width Unix time formats. A leading zero represents // a zero-padded value. // // The formats __2 and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // // A comma or decimal point followed by one or more zeros represents // a fractional second, printed to the given number of decimal places. // A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with // millisecond precision. // // Some valid layouts are invalid time values for time.Parse, due to formats // such as _ for space padding and Z for zone information. const DateOnly = "2006-01-02"

time.DateTime

// These are predefined layouts for use in Time.Format and time.Parse. // The reference time used in these layouts is the specific time stamp: // // 01/02 03:04:05PM '06 -0700 // // (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). // That value is recorded as the constant named Layout, listed below. As a Unix // time, this is 1136239445. Since MST is GMT-0700, the reference would be // printed by the Unix date command as: // // Mon Jan 2 15:04:05 MST 2006 // // It is a regrettable historic error that the date uses the American convention // of putting the numerical month before the day. // // The example for Time.Format demonstrates the working of the layout string // in detail and is a good reference. // // Note that the RFC822, RFC850, and RFC1123 formats should be applied // only to local times. Applying them to UTC times will use "UTC" as the // time zone abbreviation, while strictly speaking those RFCs require the // use of "GMT" in that case. // In general RFC1123Z should be used instead of RFC1123 for servers // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats // permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. // // Most programs can use one of the defined constants as the layout passed to // Format or Parse. The rest of this comment can be ignored unless you are // creating a custom layout string. // // To define your own format, write down what the reference time would look like // formatted your way; see the values of constants like ANSIC, StampMicro or // Kitchen for examples. The model is to demonstrate what the reference time // looks like so that the Format and Parse methods can apply the same // transformation to a general time value. // // Here is a summary of the components of a layout string. Each element shows by // example the formatting of an element of the reference time. Only these values // are recognized. Text in the layout string that is not recognized as part of // the reference time is echoed verbatim during Format and expected to appear // verbatim in the input to Parse. // // Year: "2006" "06" // Month: "Jan" "January" "01" "1" // Day of the week: "Mon" "Monday" // Day of the month: "2" "_2" "02" // Day of the year: "__2" "002" // Hour: "15" "3" "03" (PM or AM) // Minute: "4" "04" // Second: "5" "05" // AM/PM mark: "PM" // // Numeric time zone offsets format as follows: // // "-0700" ±hhmm // "-07:00" ±hh:mm // "-07" ±hh // "-070000" ±hhmmss // "-07:00:00" ±hh:mm:ss // // Replacing the sign in the format with a Z triggers // the ISO 8601 behavior of printing Z instead of an // offset for the UTC zone. Thus: // // "Z0700" Z or ±hhmm // "Z07:00" Z or ±hh:mm // "Z07" Z or ±hh // "Z070000" Z or ±hhmmss // "Z07:00:00" Z or ±hh:mm:ss // // Within the format string, the underscores in "_2" and "__2" represent spaces // that may be replaced by digits if the following number has multiple digits, // for compatibility with fixed-width Unix time formats. A leading zero represents // a zero-padded value. // // The formats __2 and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // // A comma or decimal point followed by one or more zeros represents // a fractional second, printed to the given number of decimal places. // A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with // millisecond precision. // // Some valid layouts are invalid time values for time.Parse, due to formats // such as _ for space padding and Z for zone information. const DateTime = "2006-01-02 15:04:05"

time.December

const December = iota

time.February

const February = iota

time.Friday

const Friday = iota

time.Hour

// Common durations. There is no definition for units of Day or larger // to avoid confusion across daylight savings time zone transitions. // // To count the number of units in a Duration, divide: // // second := time.Second // fmt.Print(int64(second/time.Millisecond)) // prints 1000 // // To convert an integer number of units to a Duration, multiply: // // seconds := 10 // fmt.Print(time.Duration(seconds)*time.Second) // prints 10s const Hour = 60 * Minute

time.January

const January = iota

time.July

const July = iota

time.June

const June = iota

time.Kitchen

// These are predefined layouts for use in Time.Format and time.Parse. // The reference time used in these layouts is the specific time stamp: // // 01/02 03:04:05PM '06 -0700 // // (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). // That value is recorded as the constant named Layout, listed below. As a Unix // time, this is 1136239445. Since MST is GMT-0700, the reference would be // printed by the Unix date command as: // // Mon Jan 2 15:04:05 MST 2006 // // It is a regrettable historic error that the date uses the American convention // of putting the numerical month before the day. // // The example for Time.Format demonstrates the working of the layout string // in detail and is a good reference. // // Note that the RFC822, RFC850, and RFC1123 formats should be applied // only to local times. Applying them to UTC times will use "UTC" as the // time zone abbreviation, while strictly speaking those RFCs require the // use of "GMT" in that case. // In general RFC1123Z should be used instead of RFC1123 for servers // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats // permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. // // Most programs can use one of the defined constants as the layout passed to // Format or Parse. The rest of this comment can be ignored unless you are // creating a custom layout string. // // To define your own format, write down what the reference time would look like // formatted your way; see the values of constants like ANSIC, StampMicro or // Kitchen for examples. The model is to demonstrate what the reference time // looks like so that the Format and Parse methods can apply the same // transformation to a general time value. // // Here is a summary of the components of a layout string. Each element shows by // example the formatting of an element of the reference time. Only these values // are recognized. Text in the layout string that is not recognized as part of // the reference time is echoed verbatim during Format and expected to appear // verbatim in the input to Parse. // // Year: "2006" "06" // Month: "Jan" "January" "01" "1" // Day of the week: "Mon" "Monday" // Day of the month: "2" "_2" "02" // Day of the year: "__2" "002" // Hour: "15" "3" "03" (PM or AM) // Minute: "4" "04" // Second: "5" "05" // AM/PM mark: "PM" // // Numeric time zone offsets format as follows: // // "-0700" ±hhmm // "-07:00" ±hh:mm // "-07" ±hh // "-070000" ±hhmmss // "-07:00:00" ±hh:mm:ss // // Replacing the sign in the format with a Z triggers // the ISO 8601 behavior of printing Z instead of an // offset for the UTC zone. Thus: // // "Z0700" Z or ±hhmm // "Z07:00" Z or ±hh:mm // "Z07" Z or ±hh // "Z070000" Z or ±hhmmss // "Z07:00:00" Z or ±hh:mm:ss // // Within the format string, the underscores in "_2" and "__2" represent spaces // that may be replaced by digits if the following number has multiple digits, // for compatibility with fixed-width Unix time formats. A leading zero represents // a zero-padded value. // // The formats __2 and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // // A comma or decimal point followed by one or more zeros represents // a fractional second, printed to the given number of decimal places. // A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with // millisecond precision. // // Some valid layouts are invalid time values for time.Parse, due to formats // such as _ for space padding and Z for zone information. const Kitchen = "3:04PM"

time.Layout

// These are predefined layouts for use in Time.Format and time.Parse. // The reference time used in these layouts is the specific time stamp: // // 01/02 03:04:05PM '06 -0700 // // (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). // That value is recorded as the constant named Layout, listed below. As a Unix // time, this is 1136239445. Since MST is GMT-0700, the reference would be // printed by the Unix date command as: // // Mon Jan 2 15:04:05 MST 2006 // // It is a regrettable historic error that the date uses the American convention // of putting the numerical month before the day. // // The example for Time.Format demonstrates the working of the layout string // in detail and is a good reference. // // Note that the RFC822, RFC850, and RFC1123 formats should be applied // only to local times. Applying them to UTC times will use "UTC" as the // time zone abbreviation, while strictly speaking those RFCs require the // use of "GMT" in that case. // In general RFC1123Z should be used instead of RFC1123 for servers // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats // permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. // // Most programs can use one of the defined constants as the layout passed to // Format or Parse. The rest of this comment can be ignored unless you are // creating a custom layout string. // // To define your own format, write down what the reference time would look like // formatted your way; see the values of constants like ANSIC, StampMicro or // Kitchen for examples. The model is to demonstrate what the reference time // looks like so that the Format and Parse methods can apply the same // transformation to a general time value. // // Here is a summary of the components of a layout string. Each element shows by // example the formatting of an element of the reference time. Only these values // are recognized. Text in the layout string that is not recognized as part of // the reference time is echoed verbatim during Format and expected to appear // verbatim in the input to Parse. // // Year: "2006" "06" // Month: "Jan" "January" "01" "1" // Day of the week: "Mon" "Monday" // Day of the month: "2" "_2" "02" // Day of the year: "__2" "002" // Hour: "15" "3" "03" (PM or AM) // Minute: "4" "04" // Second: "5" "05" // AM/PM mark: "PM" // // Numeric time zone offsets format as follows: // // "-0700" ±hhmm // "-07:00" ±hh:mm // "-07" ±hh // "-070000" ±hhmmss // "-07:00:00" ±hh:mm:ss // // Replacing the sign in the format with a Z triggers // the ISO 8601 behavior of printing Z instead of an // offset for the UTC zone. Thus: // // "Z0700" Z or ±hhmm // "Z07:00" Z or ±hh:mm // "Z07" Z or ±hh // "Z070000" Z or ±hhmmss // "Z07:00:00" Z or ±hh:mm:ss // // Within the format string, the underscores in "_2" and "__2" represent spaces // that may be replaced by digits if the following number has multiple digits, // for compatibility with fixed-width Unix time formats. A leading zero represents // a zero-padded value. // // The formats __2 and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // // A comma or decimal point followed by one or more zeros represents // a fractional second, printed to the given number of decimal places. // A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with // millisecond precision. // // Some valid layouts are invalid time values for time.Parse, due to formats // such as _ for space padding and Z for zone information. const Layout = "01/02 03:04:05PM '06 -0700"

time.March

const March = iota

time.May

const May = iota

time.Microsecond

// Common durations. There is no definition for units of Day or larger // to avoid confusion across daylight savings time zone transitions. // // To count the number of units in a Duration, divide: // // second := time.Second // fmt.Print(int64(second/time.Millisecond)) // prints 1000 // // To convert an integer number of units to a Duration, multiply: // // seconds := 10 // fmt.Print(time.Duration(seconds)*time.Second) // prints 10s const Microsecond = 1000 * Nanosecond

time.Millisecond

// Common durations. There is no definition for units of Day or larger // to avoid confusion across daylight savings time zone transitions. // // To count the number of units in a Duration, divide: // // second := time.Second // fmt.Print(int64(second/time.Millisecond)) // prints 1000 // // To convert an integer number of units to a Duration, multiply: // // seconds := 10 // fmt.Print(time.Duration(seconds)*time.Second) // prints 10s const Millisecond = 1000 * Microsecond

time.Minute

// Common durations. There is no definition for units of Day or larger // to avoid confusion across daylight savings time zone transitions. // // To count the number of units in a Duration, divide: // // second := time.Second // fmt.Print(int64(second/time.Millisecond)) // prints 1000 // // To convert an integer number of units to a Duration, multiply: // // seconds := 10 // fmt.Print(time.Duration(seconds)*time.Second) // prints 10s const Minute = 60 * Second

time.Monday

const Monday = iota

time.NChar

// six big-endian 32-bit integers: // number of UTC/local indicators // number of standard/wall indicators // number of leap seconds // number of transition times // number of local time zones // number of characters of time zone abbrev strings const NChar = iota

time.NLeap

// six big-endian 32-bit integers: // number of UTC/local indicators // number of standard/wall indicators // number of leap seconds // number of transition times // number of local time zones // number of characters of time zone abbrev strings const NLeap = iota

time.NStdWall

// six big-endian 32-bit integers: // number of UTC/local indicators // number of standard/wall indicators // number of leap seconds // number of transition times // number of local time zones // number of characters of time zone abbrev strings const NStdWall = iota

time.NTime

// six big-endian 32-bit integers: // number of UTC/local indicators // number of standard/wall indicators // number of leap seconds // number of transition times // number of local time zones // number of characters of time zone abbrev strings const NTime = iota

time.NUTCLocal

// six big-endian 32-bit integers: // number of UTC/local indicators // number of standard/wall indicators // number of leap seconds // number of transition times // number of local time zones // number of characters of time zone abbrev strings const NUTCLocal = iota

time.NZone

// six big-endian 32-bit integers: // number of UTC/local indicators // number of standard/wall indicators // number of leap seconds // number of transition times // number of local time zones // number of characters of time zone abbrev strings const NZone = iota

time.Nanosecond

// Common durations. There is no definition for units of Day or larger // to avoid confusion across daylight savings time zone transitions. // // To count the number of units in a Duration, divide: // // second := time.Second // fmt.Print(int64(second/time.Millisecond)) // prints 1000 // // To convert an integer number of units to a Duration, multiply: // // seconds := 10 // fmt.Print(time.Duration(seconds)*time.Second) // prints 10s const Nanosecond = 1

time.November

const November = iota

time.October

const October = iota

time.RFC1123

// These are predefined layouts for use in Time.Format and time.Parse. // The reference time used in these layouts is the specific time stamp: // // 01/02 03:04:05PM '06 -0700 // // (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). // That value is recorded as the constant named Layout, listed below. As a Unix // time, this is 1136239445. Since MST is GMT-0700, the reference would be // printed by the Unix date command as: // // Mon Jan 2 15:04:05 MST 2006 // // It is a regrettable historic error that the date uses the American convention // of putting the numerical month before the day. // // The example for Time.Format demonstrates the working of the layout string // in detail and is a good reference. // // Note that the RFC822, RFC850, and RFC1123 formats should be applied // only to local times. Applying them to UTC times will use "UTC" as the // time zone abbreviation, while strictly speaking those RFCs require the // use of "GMT" in that case. // In general RFC1123Z should be used instead of RFC1123 for servers // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats // permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. // // Most programs can use one of the defined constants as the layout passed to // Format or Parse. The rest of this comment can be ignored unless you are // creating a custom layout string. // // To define your own format, write down what the reference time would look like // formatted your way; see the values of constants like ANSIC, StampMicro or // Kitchen for examples. The model is to demonstrate what the reference time // looks like so that the Format and Parse methods can apply the same // transformation to a general time value. // // Here is a summary of the components of a layout string. Each element shows by // example the formatting of an element of the reference time. Only these values // are recognized. Text in the layout string that is not recognized as part of // the reference time is echoed verbatim during Format and expected to appear // verbatim in the input to Parse. // // Year: "2006" "06" // Month: "Jan" "January" "01" "1" // Day of the week: "Mon" "Monday" // Day of the month: "2" "_2" "02" // Day of the year: "__2" "002" // Hour: "15" "3" "03" (PM or AM) // Minute: "4" "04" // Second: "5" "05" // AM/PM mark: "PM" // // Numeric time zone offsets format as follows: // // "-0700" ±hhmm // "-07:00" ±hh:mm // "-07" ±hh // "-070000" ±hhmmss // "-07:00:00" ±hh:mm:ss // // Replacing the sign in the format with a Z triggers // the ISO 8601 behavior of printing Z instead of an // offset for the UTC zone. Thus: // // "Z0700" Z or ±hhmm // "Z07:00" Z or ±hh:mm // "Z07" Z or ±hh // "Z070000" Z or ±hhmmss // "Z07:00:00" Z or ±hh:mm:ss // // Within the format string, the underscores in "_2" and "__2" represent spaces // that may be replaced by digits if the following number has multiple digits, // for compatibility with fixed-width Unix time formats. A leading zero represents // a zero-padded value. // // The formats __2 and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // // A comma or decimal point followed by one or more zeros represents // a fractional second, printed to the given number of decimal places. // A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with // millisecond precision. // // Some valid layouts are invalid time values for time.Parse, due to formats // such as _ for space padding and Z for zone information. const RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"

time.RFC1123Z

// These are predefined layouts for use in Time.Format and time.Parse. // The reference time used in these layouts is the specific time stamp: // // 01/02 03:04:05PM '06 -0700 // // (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). // That value is recorded as the constant named Layout, listed below. As a Unix // time, this is 1136239445. Since MST is GMT-0700, the reference would be // printed by the Unix date command as: // // Mon Jan 2 15:04:05 MST 2006 // // It is a regrettable historic error that the date uses the American convention // of putting the numerical month before the day. // // The example for Time.Format demonstrates the working of the layout string // in detail and is a good reference. // // Note that the RFC822, RFC850, and RFC1123 formats should be applied // only to local times. Applying them to UTC times will use "UTC" as the // time zone abbreviation, while strictly speaking those RFCs require the // use of "GMT" in that case. // In general RFC1123Z should be used instead of RFC1123 for servers // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats // permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. // // Most programs can use one of the defined constants as the layout passed to // Format or Parse. The rest of this comment can be ignored unless you are // creating a custom layout string. // // To define your own format, write down what the reference time would look like // formatted your way; see the values of constants like ANSIC, StampMicro or // Kitchen for examples. The model is to demonstrate what the reference time // looks like so that the Format and Parse methods can apply the same // transformation to a general time value. // // Here is a summary of the components of a layout string. Each element shows by // example the formatting of an element of the reference time. Only these values // are recognized. Text in the layout string that is not recognized as part of // the reference time is echoed verbatim during Format and expected to appear // verbatim in the input to Parse. // // Year: "2006" "06" // Month: "Jan" "January" "01" "1" // Day of the week: "Mon" "Monday" // Day of the month: "2" "_2" "02" // Day of the year: "__2" "002" // Hour: "15" "3" "03" (PM or AM) // Minute: "4" "04" // Second: "5" "05" // AM/PM mark: "PM" // // Numeric time zone offsets format as follows: // // "-0700" ±hhmm // "-07:00" ±hh:mm // "-07" ±hh // "-070000" ±hhmmss // "-07:00:00" ±hh:mm:ss // // Replacing the sign in the format with a Z triggers // the ISO 8601 behavior of printing Z instead of an // offset for the UTC zone. Thus: // // "Z0700" Z or ±hhmm // "Z07:00" Z or ±hh:mm // "Z07" Z or ±hh // "Z070000" Z or ±hhmmss // "Z07:00:00" Z or ±hh:mm:ss // // Within the format string, the underscores in "_2" and "__2" represent spaces // that may be replaced by digits if the following number has multiple digits, // for compatibility with fixed-width Unix time formats. A leading zero represents // a zero-padded value. // // The formats __2 and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // // A comma or decimal point followed by one or more zeros represents // a fractional second, printed to the given number of decimal places. // A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with // millisecond precision. // // Some valid layouts are invalid time values for time.Parse, due to formats // such as _ for space padding and Z for zone information. const RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700"

time.RFC3339

// These are predefined layouts for use in Time.Format and time.Parse. // The reference time used in these layouts is the specific time stamp: // // 01/02 03:04:05PM '06 -0700 // // (January 2, 15:04:05, 2006, in time zone seven hours west of GMT). // That value is recorded as the constant named Layout, listed below. As a Unix // time, this is 1136239445. Since MST is GMT-0700, the reference would be // printed by the Unix date command as: // // Mon Jan 2 15:04:05 MST 2006 // // It is a regrettable historic error that the date uses the American convention // of putting the numerical month before the day. // // The example for Time.Format demonstrates the working of the layout string // in detail and is a good reference. // // Note that the RFC822, RFC850, and RFC1123 formats should be applied // only to local times. Applying them to UTC times will use "UTC" as the // time zone abbreviation, while strictly speaking those RFCs require the // use of "GMT" in that case. // In general RFC1123Z should be used instead of RFC1123 for servers // that insist on that format, and RFC3339 should be preferred for new protocols. // RFC3339, RFC822, RFC822Z, RFC1123, and RFC1123Z are useful for formatting; // when used with time.Parse they do not accept all the time formats // permitted by the RFCs and they do accept time formats not formally defined. // The RFC3339Nano format removes trailing zeros from the seconds field // and thus may not sort correctly once formatted. // // Most programs can use one of the defined constants as the layout passed to // Format or Parse. The rest of this comment can be ignored unless you are // creating a custom layout string. // // To define your own format, write down what the reference time would look like // formatted your way; see the values of constants like ANSIC, StampMicro or // Kitchen for examples. The model is to demonstrate what the reference time // looks like so that the Format and Parse methods can apply the same // transformation to a general time value. // // Here is a summary of the components of a layout string. Each element shows by // example the formatting of an element of the reference time. Only these values // are recognized. Text in the layout string that is not recognized as part of // the reference time is echoed verbatim during Format and expected to appear // verbatim in the input to Parse. // // Year: "2006" "06" // Month: "Jan" "January" "01" "1" // Day of the week: "Mon" "Monday" // Day of the month: "2" "_2" "02" // Day of the year: "__2" "002" // Hour: "15" "3" "03" (PM or AM) // Minute: "4" "04" // Second: "5" "05" // AM/PM mark: "PM" // // Numeric time zone offsets format as follows: // // "-0700" ±hhmm // "-07:00" ±hh:mm // "-07" ±hh // "-070000" ±hhmmss // "-07:00:00" ±hh:mm:ss // // Replacing the sign in the format with a Z triggers // the ISO 8601 behavior of printing Z instead of an // offset for the UTC zone. Thus: // // "Z0700" Z or ±hhmm // "Z07:00" Z or ±hh:mm // "Z07" Z or ±hh // "Z070000" Z or ±hhmmss // "Z07:00:00" Z or ±hh:mm:ss // // Within the format string, the underscores in "_2" and "__2" represent spaces // that may be replaced by digits if the following number has multiple digits, // for compatibility with fixed-width Unix time formats. A leading zero represents // a zero-padded value. // // The formats __2 and 002 are space-padded and zero-padded // three-character day of year; there is no unpadded day of year format. // // A comma or decimal point followed by one or more zeros represents // a fractional second, printed to the given number of decimal places. // A comma or decimal point followed by one or more nines represents // a fractional second, printed to the given number of decimal places, with // trailing zeros removed. // For example "15:04:05,000" or "15:04:05.000" formats or parses with // millisecond precision. // // Some valid layouts are invalid time values for time.Parse, due to formats // such as _ for space padding and Z for zone information. const RFC3339 = "2006-01-02T15:04:05Z07:00"