Skip to content

Commit

Permalink
Merge branch 'release/v1.0.27'
Browse files Browse the repository at this point in the history
  • Loading branch information
SheltonZhu committed Aug 11, 2024
2 parents 618c33a + c5c9b5e commit 3844105
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/driver/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func (f *File) from(fileInfo *FileInfo) *File {
f.FileID = fileInfo.FileID
f.ParentID = string(fileInfo.CategoryID)
f.IsDirectory = false
loc, _ := time.LoadLocation("Asia/Shanghai") // updatetime is a string without timezone
loc, err := time.LoadLocation("Asia/Shanghai") // updatetime is a string without timezone
if err != nil {
// if missing Asia/Shanghai use CST(UTC+8)
loc = time.FixedZone("UTC+8", 8*3600)
}
localTime, err := time.ParseInLocation("2006-01-02 15:04", fileInfo.UpdateTime, loc)
if err == nil {
f.UpdateTime = time.Unix(localTime.Unix(), 0)
Expand Down

0 comments on commit 3844105

Please sign in to comment.