Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for AppendFormatRFC3339 (0.24 sec)

  1. src/time/export_test.go

    	stdFracSecond9 | 8<<stdArgShift: ".99999999",
    	stdFracSecond9 | 9<<stdArgShift: ".999999999",
    }
    
    var Quote = quote
    
    var AppendInt = appendInt
    var AppendFormatAny = Time.appendFormat
    var AppendFormatRFC3339 = Time.appendFormatRFC3339
    var ParseAny = parse
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 24 19:23:32 UTC 2022
    - 4K bytes
    - Viewed (0)
  2. src/time/format_rfc3339.go

    // with the second most popular format only being used 8% of the time.
    // The overwhelming use of RFC 3339 compared to all other formats justifies
    // the addition of logic to optimize formatting and parsing.
    
    func (t Time) appendFormatRFC3339(b []byte, nanos bool) []byte {
    	_, offset, abs := t.locabs()
    
    	// Format date.
    	year, month, day, _ := absDate(abs, true)
    	b = appendInt(b, year, 4)
    	b = append(b, '-')
    	b = appendInt(b, int(month), 2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 18 19:59:26 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  3. src/time/format_test.go

    			loc = FixedZone("", tzOffset)
    		}
    		ts := Unix(sec, nsec).In(loc)
    
    		got := AppendFormatRFC3339(ts, nil, false)
    		want := AppendFormatAny(ts, nil, RFC3339)
    		if !bytes.Equal(got, want) {
    			t.Errorf("Format(%s, RFC3339) mismatch:\n\tgot:  %s\n\twant: %s", ts, got, want)
    		}
    
    		gotNanos := AppendFormatRFC3339(ts, nil, true)
    		wantNanos := AppendFormatAny(ts, nil, RFC3339Nano)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:58:29 UTC 2024
    - 36.4K bytes
    - Viewed (0)
  4. src/time/format.go

    func (t Time) AppendFormat(b []byte, layout string) []byte {
    	// Optimize for RFC3339 as it accounts for over half of all representations.
    	switch layout {
    	case RFC3339:
    		return t.appendFormatRFC3339(b, false)
    	case RFC3339Nano:
    		return t.appendFormatRFC3339(b, true)
    	default:
    		return t.appendFormat(b, layout)
    	}
    }
    
    func (t Time) appendFormat(b []byte, layout string) []byte {
    	var (
    		name, offset, abs = t.locabs()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 17:09:28 UTC 2024
    - 49.3K bytes
    - Viewed (0)
Back to top