Using Java's SimpleDateFormat and Google's Gson library, I'm trying to parse the date from a Json file downloaded from the Minecraft library directory. There appears to be an issue when parsing the date using the following SimpleDateFormat: yyyy-MM-dd'T'HH:mm:ssZ
I've also tried the following:
yyyy-MM-dd'T'HH:mm:ssX
yyyy-MM-dd'T'HH:mm:ssz
yyyy-MM-dd'T'HH:mm:ssx
Since the file is actually downloaded from the web, I have no means of changing it. So the solution must lie within altering my code to either not include the date, or removing the problematic code from my source. This happens to be quite a problem, since my application dies when the date is parsed, and appears to be a parsing issue, rather than a problem with the file.
The date formats are as follows:
2013-12-18T00:41:38-0500
2013-10-25T15:00:00+02:00
Both of the above dates crash it. And both of them come from separate files. I've browsed the web for multiple solutions and none of them seem to fix it.
I've even asked on the #technic
channel and browsed the TechnicLauncher
source code, and found pretty much nothing to help. And since the class I'm using is actually the exact same as the Technic Launcher, it's perplexing me. If you'd like to peruse the source code, you can take a look here: GitHub :: LauncherCore