Im having a little issue with parsing json date.
Here is what I would like to parse:
{"driver": "247","firstName": "XXXXX","lastName": "XXXXX","lastLatitudeUpdate": "5/21/2012 4:49:17 PM","suspended": "false","checkedin": "0"}
I am having trouble parsing “lastLatitudeUpdate” is it because there are spaces in between? Thanks in advance for the help.
Assuming you are on Android and therefore working with java (yes you don’t mention that, only the tag in your question suggests it…)
Like mentioned here (and in various other places) you can parse a date in java using the
SimpleDateFormatclass:Of course you have to first parse you json input with some library (e.g. standard library from json.org or Google gson) and then parse the string you’ll get there for the field into a date.