RFC3339FromTime returns an RFC3339-formatted time. If the timezone is known, the time will be converted to UTC and returned with a "Z" suffix. For unknown zones, the timezone will be "-00:01" (1 minute west of UTC). Fractional seconds are only included if the time has fractional seconds.
(t time.Time)
| 933 | // Fractional seconds are only included if the time has fractional |
| 934 | // seconds. |
| 935 | func RFC3339FromTime(t time.Time) string { |
| 936 | if IsZoneKnown(t) { |
| 937 | t = t.UTC() |
| 938 | } |
| 939 | if t.UnixNano()%1e9 == 0 { |
| 940 | return t.Format(time.RFC3339) |
| 941 | } |
| 942 | return t.Format(time.RFC3339Nano) |
| 943 | } |
| 944 | |
| 945 | var bytesCamliVersion = []byte("camliVersion") |
| 946 |