/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
pkg/fs/modtime.go
20 строк
398 B
Michael Mayer
Metadata: Use file mod time instead of birth time as fallback #4157
08 апр 2024, 21:44
08 апр 2024, 21:44
e5c5ce2
Код
Авторство
О чём код?
package fs import ( "time" "github.com/djherbis/times" ) // ModTime returns the last modification time of a file or directory in UTC. func ModTime(filePath string) time.Time { stat, err := times.Stat(filePath) // Return the current time if Stat() call failed. if err != nil { return time.Now().UTC() } // Return modification time as reported by Stat(). return stat.ModTime().UTC() }