Code example for SimpleDateFormat

Methods: format

0
      Date begin_of_day = cal.getTime();
       
      if(date.before(begin_of_day)){
        dateFormt = new SimpleDateFormat("MM-dd");
      } else { 
        dateFormt = new SimpleDateFormat("HH:mm");
      } 
    } else { 
      dateFormt = new SimpleDateFormat("MM-dd HH:mm");
    } 
     
    return dateFormt.format(date);
  } 
   
  public static final class SMS implements BaseColumns {
    public static final Uri INBOX_URI = Uri.parse("content://sms/inbox");
     
    public static final String THREAD_ID = "thread_id";
    public static final String ADDRESS = "address";
    public static final String SUBJECT = "subject";
    public static final String BODY = "body";