I would like to know, how to get date of a certain time zone and update hours , mins and seconds of it. For example
if EST time now is 20230710 05:22:22 I want to update it to 20230710 01:25:00 and also get previous date and set time to 20230709 01:25:00
Using below i am getting EST time , but I am not able update the hour,mins and secs Please advise
TimeZone tz = TimeZone.getTimeZone("EST");
long utc = System.currentTimeMillis();
Date currentTime = new Date(utc);
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
df.setTimeZone(tz);
String s = df.format(currentTime).replace("-", "");