List of utility methods to do String to Timestamp
Date | timeStampToDate(String timeStamp) time Stamp To Date if (timeStamp != null) { try { return new SimpleDateFormat("ddMMyyyyHHmmssSSS").parse(timeStamp); } catch (Exception e) { return null; } else { return null; ... |
java.util.Date | toTimeStamp(String argS) to Time Stamp java.util.Date date = null; SimpleDateFormat newFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss"); try { date = (java.util.Date) newFormat.parse(argS); } catch (Exception eException) { return date; |
long | toTimeStamp(String myDate, String pattern, Locale language) to Time Stamp SimpleDateFormat sdf = new SimpleDateFormat(pattern, language); try { Date time = sdf.parse(myDate); return time.getTime(); } catch (ParseException e) { throw new RuntimeException(e); |
Date | toTimestamp(String source) to Timestamp return parse(source, TIMESTAMP_FORMAT);
|
String | ToTimestamp(String user_time) To Timestamp String re_time = null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); Date d; try { d = sdf.parse(user_time); long l = d.getTime(); String str = String.valueOf(l); re_time = str.substring(0, 10); ... |