Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for appendStrictRFC3339 (0.24 sec)

  1. src/time/format_rfc3339.go

    	if zone < 0 {
    		b = append(b, '-')
    		zone = -zone
    	} else {
    		b = append(b, '+')
    	}
    	b = appendInt(b, zone/60, 2)
    	b = append(b, ':')
    	b = appendInt(b, zone%60, 2)
    	return b
    }
    
    func (t Time) appendStrictRFC3339(b []byte) ([]byte, error) {
    	n0 := len(b)
    	b = t.appendFormatRFC3339(b, true)
    
    	// Not all valid Go timestamps can be serialized as valid RFC 3339.
    	// Explicitly check for these edge cases.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 18 19:59:26 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  2. src/time/time.go

    // (e.g., the year is out of range), then an error is reported.
    func (t Time) MarshalJSON() ([]byte, error) {
    	b := make([]byte, 0, len(RFC3339Nano)+len(`""`))
    	b = append(b, '"')
    	b, err := t.appendStrictRFC3339(b)
    	b = append(b, '"')
    	if err != nil {
    		return nil, errors.New("Time.MarshalJSON: " + err.Error())
    	}
    	return b, nil
    }
    
    // UnmarshalJSON implements the [json.Unmarshaler] interface.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 50.7K bytes
    - Viewed (0)
Back to top