Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Add Future Date in AndroidStudio

String dt = "2012-01-04";  // Start date
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
try {
    c.setTime(sdf.parse(dt));
} catch (ParseException e) {
    e.printStackTrace();
}
c.add(Calendar.DATE, 40);  // number of days to add, can also use Calendar.DAY_OF_MONTH in place of Calendar.DATE
SimpleDateFormat sdf1 = new SimpleDateFormat("MM-dd-yyyy");
String output = sdf1.format(c.getTime());
Comment

PREVIOUS NEXT
Code Example
Java :: jsf prefix tag 
Java :: JAVA CHAR TO keyevents 
Java :: path.resolve java 
Java :: Java Stack class search() method 
Java :: difido 
Java :: Simple java questionnaire using json 
Java :: tipe data c++ 
Java :: turn on device location android programmatically 
Java :: how to run the war file in Apache Tomcat/8.5.59 THROUGH SPRING 
Java :: instance block 
Java :: convert subarray to list java 
Java :: what is a producedure java 
Java :: how to wirte an XPlane Plugin 
Java :: how to read space separated characters in java 
Java :: get number value of an output to another script java 
Java :: how to make a typewriter effect in jaca 
Java :: Java Create an OutputStreamWriter 
Java :: initialcontext tomcat bug 
Java :: reading data from wsdl in java 
Java :: fail method java 
Java :: java to kotlin online convertor 
Java :: heap vs string constant pool 
Java :: java konsolenausgabe 
Java :: how to use set ForceDarkAllowed(false); in android studio 
Java :: Java lAccess TreeMap Elements 
Java :: how to get listview data, TextView 
Java :: java new.JFrame(); 
Java :: Statement sql= clsConexion.getConexion().createStatement(); 
Java :: unmappable character java 
Java :: online currency rate api 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =