I am trying to use stackexchange api. In this link I am trying to get some users information.
If you run, it you will get the JSON response.
{
"items": [
{
"badge_counts": {
"bronze": 5630,
"silver": 4212,
"gold": 267
},
"account_id": 11683,
"is_employee": false,
"last_modified_date": 1398827800,
"last_access_date": 1398799412,
"reputation_change_year": 34829,
"reputation_change_quarter": 7965,
"reputation_change_month": 7965,
"reputation_change_week": 930,
"reputation_change_day": 60,
"reputation": 669736,
"creation_date": 1222430705,
"user_type": "registered",
"user_id": 22656,
"age": 37,
"accept_rate": 88,
"location": "Reading, United Kingdom",
"website_url": "http://csharpindepth.com",
"link": "http://stackoverflow.com/users/22656/jon-skeet",
"display_name": "Jon Skeet",
"profile_image": "https://www.gravatar.com/avatar/6d8ebb117e8d83d74ea95fbdd0f87e13?s=128&d=identicon&r=PG"
},
{
"badge_counts": {
"bronze": 1646,
"silver": 1456,
"gold": 64
},
"account_id": 14332,
"is_employee": false,
"last_modified_date": 1397859689,
"last_access_date": 1398787554,
"reputation_change_year": 26427,
"reputation_change_quarter": 5693,
"reputation_change_month": 5693,
"reputation_change_week": 640,
"reputation_change_day": 20,
"reputation": 513076,
"creation_date": 1224432467,
"user_type": "registered",
"user_id": 29407,
"age": 32,
"accept_rate": 91,
"location": "Sofia, Bulgaria",
"website_url": "http://stackoverflow.com/search?q=user%3a29407&tab=newest",
"link": "http://stackoverflow.com/users/29407/darin-dimitrov",
"display_name": "Darin Dimitrov",
"profile_image": "https://www.gravatar.com/avatar/e3a181e9cdd4757a8b416d93878770c5?s=128&d=identicon&r=PG"
},
If you see, the date fields are not deserialized. It gives a number instead of date format.
How to get the JSON response in the appropriated date format?
I am trying to use this URL in my Java code to get JSON response as String and it's working. But I want to parse it to an object. I have to create class for items, and badge_counts with fields required in it. The date fields must be date not integers. While parsing to object from string response, there may be parsing exception. So how can I resolve that?