Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.text.TextUtils;

public class Main {
    public static boolean compareDate(String startDate, String endDate) {
        if (TextUtils.isEmpty(startDate) || TextUtils.isEmpty(endDate)) {
            return false;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHH");
        try {
            Date dt1 = sdf.parse(startDate);
            Date dt2 = sdf.parse(endDate);
            return dt1.after(dt2);
        } catch (Exception e) {
            return false;
        }
    }
}