Java Utililty Methods String to Timestamp

List of utility methods to do String to Timestamp

Description

The list of methods to do String to Timestamp are organized into topic(s).

Method

DatetimeStampToDate(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.DatetoTimeStamp(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;
longtoTimeStamp(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);
DatetoTimestamp(String source)
to Timestamp
return parse(source, TIMESTAMP_FORMAT);
StringToTimestamp(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);
...