Code example for Date

Methods: getDategetMonth

	public static String getDate(Date date){
		String monthString = "";
			case 0:monthString="Jan";break;
			case 1:monthString="Feb";break;
			case 2:monthString="Mar";break;
			case 3:monthString="Apr";break;
			case 4:monthString="May";break;
			case 5:monthString="Jun";break;
			case 6:monthString="Jul";break;
			case 7:monthString="Aug";break;
			case 8:monthString="Sep";break;
			case 9:monthString="Oct";break;
			case 10:monthString="Nov";break;
			case 11:monthString="Dec";break;
		return date.getDate()+"-"+monthString;
	public static String getTime(Date date){
		SimpleDateFormat sdf = new SimpleDateFormat("h:mm a");
		return sdf.format(date);
Connect your IDE to all the code out there  Get Codota for Java