mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00: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
1 changed files with 2 additions and 1 deletions
|
@ -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…
Reference in a new issue