Answers for "convert string to calendar in java"

2

convert date to calendar java

public static Calendar toCalendar(Date date){ 
  Calendar cal = Calendar.getInstance();
  cal.setTime(date);
  return cal;
}
Posted by: Guest on April-15-2020
0

string to calendar

Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH);
cal.setTime(sdf.parse("Mon Mar 14 16:02:37 GMT 2011"));// all done
Posted by: Guest on November-28-2020

Code answers related to "convert string to calendar in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language