mirror of
https://github.com/writeas/writefreely
synced 2025-01-31 20:24:48 +01:00
Fix unix timestamp in file upload
File API gives timestamp in milliseconds, not seconds, so this converts it correctly. Ref T609
This commit is contained in:
parent
aae2f28bb6
commit
2b066997d1
@ -146,7 +146,8 @@ func handleImport(app *App, u *User, w http.ResponseWriter, r *http.Request) err
|
||||
if collAlias != "" {
|
||||
post.Collection = collAlias
|
||||
}
|
||||
dateTime := time.Unix(fileDates[formFile.Filename], 0)
|
||||
ts := fileDates[formFile.Filename] / 1000 // Get timestamp in seconds, not milliseconds
|
||||
dateTime := time.Unix(ts, 0)
|
||||
post.Created = &dateTime
|
||||
created := post.Created.Format("2006-01-02T15:04:05Z")
|
||||
submittedPost := SubmittedPost{
|
||||
|
Loading…
x
Reference in New Issue
Block a user