Time comparation in Java


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public static boolean isDateBefore(String date1,String date2){
  2. try{
  3. DateFormat df = DateFormat.getDateTimeInstance();
  4. return df.parse(date1).before(df.parse(date2));
  5. }catch(ParseException e){
  6. System.out.print("[SYS] " + e.getMessage());
  7. return false;
  8. }
  9. }

URL: http://dev.csdn.net/article/68/68912.shtm

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.