I have collect the London time from Google . I want to get GMT+6 time and Date. I tried many ways but i can't reach to my destination . Can anyone please help me to solve this. I have converted all string to int .
Here is My Code :
CurrentDate = Date[1]+"/"+Month+"/" + Date[3];
// String dateFormat = Date[0]
String[] Timee = Date[4].split(":");
int hour = Integer.parseInt(Timee[0]);
Log.e("Timeee", hour + " -- " + Timee[1] + " --" + Timee[2]);
int seconds = Integer.parseInt(Timee[2]);
int minutes = Integer.parseInt(Timee[1]);
CurrentTime = seconds + minutes + hour;
int date = Integer.parseInt(Date[1]);
int year = Integer.parseInt(Date[3]);
CurrentTime2 = Date[3]+"-" + Month +"-"+"-" + Date[1] +" " + hour+":" +Timee[1]+":"+Timee[2];
Date date1 = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
date1 = sdf.parse(CurrentTime2);
}catch (Exception e){
}
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Kolkata"));
// System.out.println(sdf.format(date));
Log.e("@@@Date: ",String.valueOf(sdf.format(date1)));
DateAndTime = String.valueOf(sdf.format(date1));