MCPcopy
hub / github.com/rclone/rclone / formatForPrecision

Function formatForPrecision

fs/operations/lsjson.go:51–73  ·  view source on GitHub ↗

Returns a time format for the given precision

(precision time.Duration)

Source from the content-addressed store, hash-verified

49
50// Returns a time format for the given precision
51func formatForPrecision(precision time.Duration) string {
52 switch {
53 case precision <= time.Nanosecond:
54 return "2006-01-02T15:04:05.000000000Z07:00"
55 case precision <= 10*time.Nanosecond:
56 return "2006-01-02T15:04:05.00000000Z07:00"
57 case precision <= 100*time.Nanosecond:
58 return "2006-01-02T15:04:05.0000000Z07:00"
59 case precision <= time.Microsecond:
60 return "2006-01-02T15:04:05.000000Z07:00"
61 case precision <= 10*time.Microsecond:
62 return "2006-01-02T15:04:05.00000Z07:00"
63 case precision <= 100*time.Microsecond:
64 return "2006-01-02T15:04:05.0000Z07:00"
65 case precision <= time.Millisecond:
66 return "2006-01-02T15:04:05.000Z07:00"
67 case precision <= 10*time.Millisecond:
68 return "2006-01-02T15:04:05.00Z07:00"
69 case precision <= 100*time.Millisecond:
70 return "2006-01-02T15:04:05.0Z07:00"
71 }
72 return time.RFC3339
73}
74
75// ListJSONOpt describes the options for ListJSON
76type ListJSONOpt struct {

Callers 1

newListJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…