-
-
Notifications
You must be signed in to change notification settings - Fork 69
Description
When I update a custom date value to Parse, it does something wrong with the timezone. If I look in the database, it clearly shows that it added +1 hour. But when I read it in the app with ParseSwift, it shows it correctly.
I think there is something wrong with the conversion of Dates
when uploading and reading from Parse.
We also have a website, and with the Parse API for PHP it does upload the correct date. So if we look in the database, the timeStamp
is the same as updatedAt
. But when reading that same timeStamp value in ParseSwift, it makes the date -1 hour. This is causing some issues for us.
I have this code:
let query = AppFiles.query("score" == score)
query.first(callbackQueue: .main) { results in
switch results {
case .success(var userFile):
userFile.timeStamp = Date()
userFile.save { result in
switch result {
case .success(_):
print("SUCCES")
case .failure(let error):
print("FAIL")
print(error)
}
}
case .failure(let error):
print(error)
}
}
This is a picture of what the dates look like when it is updated from the ParseSwift API:
So to wrap this issue up:
When updating the timeStamp from ParseSwift:
Dashboard shows this: 2021-03-27 16:31:40 +0000
Logging in swift shows this: 2021-03-27 15:31:40 +0000
When updating the timeStamp from Parse PHP:
Dashboard shows this: 2021-03-27 15:31:40 +0000
Logging in swift shows this: 2021-03-27 14:31:40 +0000