Java Utililty Methods Timestamp Parse

List of utility methods to do Timestamp Parse

Description

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

Method

Dateparse(java.sql.Timestamp timestamp)
parse
if (timestamp == null)
    return null;
return new Date(timestamp.getTime() * 1000);
DateparseAsCassandraTimestamp(String dateString)
parse As Cassandra Timestamp
SimpleDateFormat parser = new SimpleDateFormat();
parser.setLenient(false);
for (String pattern : CASSANDRA_TS_PATTERNS) {
    parser.applyPattern(pattern);
    try {
        return parser.parse(dateString);
    } catch (ParseException e) {
throw new ParseException("Unable to parse as date [" + dateString + "]", -1);
TimestampparseDateTimeToTimestamp(String string)
yyyy-MM-dd HH:mm:ss
Timestamp result = null;
try {
    Date date = allDateFmt.parse(string);
    result = new Timestamp(date.getTime());
} catch (ParseException e) {
    e.printStackTrace();
return result;
...
longparseHeaderDate(String timestamp)
Parses a formated date and time string in HTTP-Header date format and returns the time value.

return HEADER_DEFAULT.parse(timestamp).getTime();
DateparseSnapshotTimestamp(final String tstamp)
parse Snapshot Timestamp
return getFormat().parse(tstamp);
TimestampparseSQLiteTimestamp(String dd)
parse SQ Lite Timestamp
try {
    return new Timestamp(SQLITE_DATE_FMT.parse(dd).getTime());
} catch (Exception e) {
    return new Timestamp(System.currentTimeMillis());
DateparseStopTime(String timestamp, String timezone)
parse Stop Time
TimeZone tz = timeZoneForCode(timezone);
DateFormat sdf = new SimpleDateFormat("M/d/y H:m:s");
sdf.setTimeZone(tz);
return sdf.parse(timestamp);
java.sql.TimestampparseTimestamp(Date date)
parse Timestamp
if (date == null)
    return null;
long t = date.getTime();
return new java.sql.Timestamp(t);
TimestampparseTimestamp(Date date)
parse Timestamp
if (date == null) {
    return null;
return new Timestamp(date.getTime());
longparseTimestamp(final String format, final String time)
parse Timestamp
try {
    final DateFormat dateFormat = getDateFormat(format);
    synchronized (dateFormat) {
        return dateFormat.parse(time).getTime();
} catch (final Exception e) {
    return 0;