What is the function to get the current UTC time. I have tried with System.getCurrentTime but i get the current date and time of the device.
Thanks
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.
System.currentTimeMillis()does give you the number of milliseconds since January 1, 1970 00:00:00 UTC. The reason you see local times might be because you convert aDateinstance to a string before using it. You can useDateFormats to convertDates toStrings in any timezone:Also see this related question.