Check out example codes for "java Calendar add time". It will help you in understanding the concepts better.

Code Example 1

Calendar calendar = Calendar.getInstance();  
// 15 days ago
calendar.add(Calendar.DATE, -15); 
// After 4 months
calendar.add(Calendar.MONTH, 4);

Learn ReactJs, React Native from akashmittal.com