Android Utililty Methods Timestamp String to Timestamp Convert

List of utility methods to do Timestamp String to Timestamp Convert

Description

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

Method

Timestampstr2Timestamp(String str)
str Timestamp
if (str == null)
    return null;
str = str.trim();
if (!str.matches("^\\d\\d\\d\\d-\\d\\d-\\d\\d$")
        && !str.matches("^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d$"))
    return null;
String[] ss = str.split("-| |:");
GregorianCalendar gc = new GregorianCalendar();
...
TimestampstringConvertTimestamp(String time)
string Convert Timestamp
if (null == time || "".equals(time)) {
    return null;
if (time.length() == 10) {
    time = time + " 00:00:00.000000000";
} else if (time.length() == 16) {
    time = time + ":00.000000000";
} else if (time.length() == 19) {
...
DateserverTimestampToDate(String timestamp)
server Timestamp To Date
try {
    return new SimpleDateFormat(SERVER_DATE_FORMAT, Locale.GERMANY)
            .parse(timestamp);
} catch (ParseException e) {
    return new Date();