XcodesOrg / XcodesApp

The easiest way to install and switch between multiple versions of Xcode - with a mouse click.
MIT License
7.02k stars 308 forks source link

Error downloading any version: "Date string does not match format expected by formatter" #329

Closed yossizahn closed 1 year ago

yossizahn commented 1 year ago

Describe the bug I get an error downloading any version: "Date string does not match format expected by formatter" The full message is:

The operation couldn’t be completed. (Error.dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "downloads", intValue: nil), _JSONKey(stringValue: "Index 2", intValue: 2), CodingKeys(stringValue: "dateModified", intValue: nil)], debugDescription: "Date string does not match format expected by formatter.", underlyingError: nil)))

The actual value in the JSON (at ["downloads"][2]["dateModified"] retrieved through mitmproxy) is:

03/23/12 02:18

To Reproduce Try downloading any version of Xcode using Xcodes

Expected behavior It should work...

Version

yossizahn commented 1 year ago

Maybe applicable: CleanShot 2022-11-23 at 12 32 03@2x

yossizahn commented 1 year ago

I got it The hour from 2AM to 3AM on the specific date does not exist due to skipping an hour for DST :facepalm:

Now what?

Edit: Is this a bug in Fonudation since DST seems to have gone into effect on Mar 30 in 2012 in my locale https://www.timeanddate.com/time/change/israel/jerusalem?year=2012

yossizahn commented 1 year ago

Test code:

import Foundation

let df = DateFormatter()
df.dateFormat = "MM/dd/yy HH:mm"
print(df.date(from: "03/23/12 02:18"))
yossizahn commented 1 year ago

Found this: https://stackoverflow.com/questions/71415071/swift-date-parsing-on-daylight-saving-time

BenjiMandel commented 1 year ago

Did you get the app working? I have this issues every so often, and its really annoying

yossizahn commented 1 year ago

This problem only exists in certain timezones. Changing your timezone in System Settings (temporarily, while downloading a new xcode) will solve the issue