MCPcopy
hub / github.com/rclone/rclone / AddModTime

Method AddModTime

fs/operations/operations.go:2238–2258  ·  view source on GitHub ↗

AddModTime adds file's Mod Time to output

(timeFormat string)

Source from the content-addressed store, hash-verified

2236
2237// AddModTime adds file's Mod Time to output
2238func (l *ListFormat) AddModTime(timeFormat string) {
2239 switch timeFormat {
2240 case "":
2241 l.AppendOutput(func(entry *ListJSONItem) string {
2242 return entry.ModTime.When.Local().Format("2006-01-02 15:04:05")
2243 })
2244 case "unix":
2245 l.AppendOutput(func(entry *ListJSONItem) string {
2246 return fmt.Sprint(entry.ModTime.When.Unix())
2247 })
2248 case "unixnano":
2249 l.AppendOutput(func(entry *ListJSONItem) string {
2250 return fmt.Sprint(entry.ModTime.When.UnixNano())
2251 })
2252 default:
2253 timeFormat = transform.TimeFormat(timeFormat)
2254 l.AppendOutput(func(entry *ListJSONItem) string {
2255 return entry.ModTime.When.Local().Format(timeFormat)
2256 })
2257 }
2258}
2259
2260// AddSize adds file's size to output
2261func (l *ListFormat) AddSize() {

Callers 4

LsfFunction · 0.95
DstLsfFunction · 0.95
TestListFormatFunction · 0.95
SetListFormatMethod · 0.95

Calls 3

AppendOutputMethod · 0.95
TimeFormatFunction · 0.92
FormatMethod · 0.80

Tested by 2

DstLsfFunction · 0.76
TestListFormatFunction · 0.76