Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix date encoding/decoding #103

Merged
merged 1 commit into from Mar 27, 2021
Merged

Fix date encoding/decoding #103

merged 1 commit into from Mar 27, 2021

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Mar 27, 2021

The date formatting for encoding/decoding dates was not being set properly, causing times to match on the server.

Apple recommends the following for fixed format date representations:

let RFC3339DateFormatter = DateFormatter()
RFC3339DateFormatter.locale = Locale(identifier: "en_US_POSIX")
RFC3339DateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" //Parse uses "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" instead
RFC3339DateFormatter.timeZone = TimeZone(secondsFromGMT: 0)

Fix #102

@codecov
Copy link

codecov bot commented Mar 27, 2021

Codecov Report

Merging #103 (5da1268) into main (96b26a5) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head 5da1268 differs from pull request most recent head afc29c2. Consider uploading reports for the commit afc29c2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
- Coverage   81.05%   81.00%   -0.06%     
==========================================
  Files          65       65              
  Lines        5480     5474       -6     
==========================================
- Hits         4442     4434       -8     
- Misses       1038     1040       +2     
Impacted Files Coverage Δ
...Swift/Authentication/3rd Party/ParseFacebook.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Coding/ParseCoding.swift 89.36% <100.00%> (+0.23%) ⬆️
Sources/ParseSwift/Storage/ParseFileManager.swift 89.39% <0.00%> (-0.76%) ⬇️
Sources/ParseSwift/Objects/ParseObject.swift 76.77% <0.00%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96b26a5...afc29c2. Read the comment docs.

@cbaker6 cbaker6 closed this Mar 27, 2021
@cbaker6 cbaker6 reopened this Mar 27, 2021
@cbaker6 cbaker6 merged commit a233682 into main Mar 27, 2021
@cbaker6 cbaker6 deleted the date branch March 27, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date not uploading correctly for different timezones
1 participant