I write a countdown timer and i set time for that and when i show the time its set hour+1 how can i correct it here is my code
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
future=dateFormat.parse("2018-09-25 15:00:00");
Date now=new Date();
if (!now.after(future)) {
long diff = future.getTime() - now.getTime();
long days = diff / (24 * 60 * 60 * 1000);
diff -= days * (24 * 60 * 60 * 1000);
long hours = diff / (60 * 60 * 1000);
diff -= hours *( 60 * 60 * 1000);
}
...... for example if it should count from 1day 13:00:00, it count from 14