I am using google data api which gives date in datetime format. I want to convert this DateTime format date in Gregorian calendar date format. Does anyone know any methods for doing this?
**Edited the question*
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.
That class is definitely not Google’s best work (I link to the API so I can confirm we are talking about the same class and version). Here is what I would do:
Sample usage:
From there you can make a Calendar. Dealing with what to do if the DateTime represents a Date only, and timezone issues, you can deal with from there (I don’t know your requirements) but if you have to get serious about it, use JodaTime to handle this as much as possible.