Here you can find the source of GetDay(String agmipDate)
public static String GetDay(String agmipDate) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static final SimpleDateFormat apsim = new SimpleDateFormat("dd/MM/yyyy"); public static String GetDay(String agmipDate) throws ParseException { Date date = apsim.parse(agmipDate); Calendar c = Calendar.getInstance(); c.setTime(date);//from ww w . jav a 2 s . c om return c.get(Calendar.DAY_OF_YEAR) + ""; } }