Code example for SimpleDateFormat

Methods: parse

0
    // MILLISECONDS 
    return String.format("%dms", iTime);
  } 
 
  public static Date getTodayWithTime(final String iTime) throws ParseException {
    final SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
    final long today = System.currentTimeMillis();
    final Date rslt = new Date();
    rslt.setTime(today - (today % DAY) + df.parse(iTime).getTime());
    return rslt;
  } 
 
  public static String readFileAsString(final File iFile) throws java.io.IOException {
    return readStreamAsString(new FileInputStream(iFile));
  } 
 
  public static String readStreamAsString(final InputStream iStream) throws java.io.IOException {
    final StringBuffer fileData = new StringBuffer(1000);
    final BufferedReader reader = new BufferedReader(new InputStreamReader(iStream));
    try { 
Contextual code suggestions in your IDE  Get Codota for Java