展开全部
我写了一个把e69da5e6ba9062616964757a686964616f31333335306232当前时间转换为毫秒数的例子,你参考一下,我这运行没问题:
package test;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author Administrator
*当前时间转换为毫秒数
*/
public class DeclareTimer {
public static void main(String[] args) throws ParseException {
//获取当前时间
Timestamp t = new Timestamp(new Date().getTime());
System.out.println("当前时间:"+t);
//定义时间格式
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
String str = dateFormat.format(t);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmm");
//此处转换为毫秒数
long millionSeconds = sdf.parse(str).getTime();// 毫秒
System.out.println("毫秒数:"+millionSeconds);
}
}