9/4/2014 3:55:10 AM
here is my current date and time i want to add +10 hour so that i cam match with Current time of device please tell me how we can implement
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
String currentDateandTime =" 9/4/2014 3:55:10 AM ";
Date date = formatter.parse(currentDateandTime);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.HOUR, 10);
System.out.println("Time here "+calendar.getTime());
}
This Code am trying but i am not able to Impalement please help me where am doing mistake .