I got the following date format that I get from an API (Yes I tried to get them to change the API… dailywtf story):
\/Date(1310481956000+0200)\/
How can I convert this into a Java Date? (java.util.Date)
This comes from a .NET JSON web service.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Without knowing what the date/time string stands for, let me make a guess.
The
1310481956000looks to be milliseconds after epoch, and the+0200an offset relative to GMT.The following code seem to indicate it as well:
Prints
2011-07-12 16:45:56 GMT+02:00