- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for UnixMicro (0.46 sec)
-
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go
func TestMicroTimeUnmarshalJSONAndProtoEqual(t *testing.T) { cases := []struct { name string input MicroTime result bool }{ {"nanosecond level precision", UnixMicro(123, 123123123), true}, {"microsecond level precision", UnixMicro(123, 123123000), true}, } for _, c := range cases { t.Run(c.name, func(t *testing.T) { jsonData, err := c.input.MarshalJSON() if err != nil {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:10 UTC 2024 - 11.1K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
if t == nil && u == nil { return true } if t != nil && u != nil { return t.Time.Equal(u.Time) } return false } // UnixMicro returns the local time corresponding to the given Unix time // by wrapping time.Unix. func UnixMicro(sec int64, nsec int64) MicroTime { return MicroTime{time.Unix(sec, nsec)} } // UnmarshalJSON implements the json.Unmarshaller interface.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:10 UTC 2024 - 5.2K bytes - Viewed (0) -
src/time/time_test.go
{"UnixNano", func(t1, t2 Time) bool { return t1.UnixNano() == t2.UnixNano() }}, {"UnixMilli", func(t1, t2 Time) bool { return t1.UnixMilli() == t2.UnixMilli() }}, {"UnixMicro", func(t1, t2 Time) bool { return t1.UnixMicro() == t2.UnixMicro() }}, {"MarshalBinary", func(t1, t2 Time) bool { a1, b1 := t1.MarshalBinary() a2, b2 := t2.MarshalBinary() return bytes.Equal(a1, a2) && b1 == b2 }},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:13:47 UTC 2024 - 56.5K bytes - Viewed (0) -
src/time/example_test.go
// Output: // 1257894000 // 2009-11-10 23:00:00 +0000 UTC } func ExampleUnixMicro() { umt := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC) fmt.Println(umt.UnixMicro()) t := time.UnixMicro(umt.UnixMicro()).UTC() fmt.Println(t) // Output: // 1257894000000000 // 2009-11-10 23:00:00 +0000 UTC } func ExampleUnixMilli() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Feb 13 01:05:00 UTC 2024 - 22.4K bytes - Viewed (0) -
api/go1.17.txt
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 17 20:31:46 UTC 2023 - 18K bytes - Viewed (0) -
src/time/time.go
} // UnixMicro returns t as a Unix time, the number of microseconds elapsed since // January 1, 1970 UTC. The result is undefined if the Unix time in // microseconds cannot be represented by an int64 (a date before year -290307 or // after year 294246). The result does not depend on the location associated // with t. func (t Time) UnixMicro() int64 { return t.unixSec()*1e6 + int64(t.nsec())/1e3
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 17:58:53 UTC 2024 - 50.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"(Time).Second", Method, 0}, {"(Time).String", Method, 0}, {"(Time).Sub", Method, 0}, {"(Time).Truncate", Method, 1}, {"(Time).UTC", Method, 0}, {"(Time).Unix", Method, 0}, {"(Time).UnixMicro", Method, 17}, {"(Time).UnixMilli", Method, 17}, {"(Time).UnixNano", Method, 0}, {"(Time).Weekday", Method, 0}, {"(Time).Year", Method, 0}, {"(Time).YearDay", Method, 1},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)