calculate days between two dates in java
import java.util.Date;
import java.text.SimpleDateFormat;
class Example{
public static void main(String args[]){
SimpleDateFormat myFormat = new SimpleDateFormat("dd MM yyyy");
String dateBeforeString = "31 01 2014";
String dateAfterString = "02 02 2014";
try {
Date dateBefore = myFormat.parse(dateBeforeString);
Date dateAfter = myFormat.parse(dateAfterString);
long difference = dateAfter.getTime() - dateBefore.getTime();
float day