Skip to content

Instantly share code, notes, and snippets.

@devrath
Created December 17, 2014 12:26
Show Gist options
  • Select an option

  • Save devrath/7b4886d8c61e5c987b07 to your computer and use it in GitHub Desktop.

Select an option

Save devrath/7b4886d8c61e5c987b07 to your computer and use it in GitHub Desktop.
Indian UTC time ZONE conversion
String date=jsonobject.getString("needbydate");
DateFormat df = new SimpleDateFormat("MMM/dd/yyyy",Locale.ENGLISH);
df.setTimeZone(TimeZone.getTimeZone("UTC"));
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss",Locale.ENGLISH);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date startDate;
startDate = sdf.parse(date);
needbydate = df.format(startDate).toString()+"";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment