I'm trying to get it to be 12 hours ahead of what it is, it doesn't work but anything lower works, unsure on how to fix it.
package New;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
public class DateManipulation {
public static void main(String[] args) {
Date date = new Date();
String test = new SimpleDateFormat("MM-dd-yy").format(date);
System.out.println(test);
DateFormat sdf = new SimpleDateFormat("hh:mm:ss");
try {
date.setTime(date.getTime()+43200000l);
String time = sdf.format(date);
System.out.println(time);
} catch (Exception e) {
e.printStackTrace();
}
}
}
HMU With any solutions