java calendar class format
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
System.out.println(dateFormat.format(date)); //2013/10/15 16:16:39
java calendar class format
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
System.out.println(dateFormat.format(date)); //2013/10/15 16:16:39
java Calendar add time
Calendar calendar = Calendar.getInstance();
// 15 days ago
calendar.add(Calendar.DATE, -15);
// After 4 months
calendar.add(Calendar.MONTH, 4);
java Calender examokes
// Get curremt time and date.
Calendar calendar = Calendar.getInstance();
System.out.println("The current date is : " + calendar.getTime());
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us