Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @SuppressWarnings("deprecation") public static int getDay(String date) { try { return simpleDateFormat.parse(date).getDate(); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return 0; } }