Here you can find the source of parseTimestamp(String s)
public static Timestamp parseTimestamp(String s)
//package com.java2s; //License from project: BSD License import java.sql.Timestamp; public class Main { public static Timestamp parseTimestamp(String s) { Timestamp value;/*from w w w. j a v a2s . c o m*/ if (s.indexOf(':') > 0) { value = Timestamp.valueOf(s); } else if (s.indexOf('.') >= 0) { // it's a float value = new Timestamp((long) ((double) (Double.parseDouble(s) * 1000))); } else { // integer value = new Timestamp(Long.parseLong(s) * 1000); } return value; } public static long parseLong(String s) { if (isHex(s)) { return Long.parseLong(s.substring(2), 16); } else { return Long.parseLong(s); } } public static boolean isHex(String s) { return s.startsWith("0x") || s.startsWith("0X"); } }