java calendar add time

Solutions on MaxInterview for java calendar add time by the best coders in the world

showing results for - "java calendar add time"
Eren
25 Jan 2018
1Calendar calendar = Calendar.getInstance();  
2// 15 days ago
3calendar.add(Calendar.DATE, -15); 
4// After 4 months
5calendar.add(Calendar.MONTH, 4);