读书人

时间格式转入毫秒

发布时间: 2012-09-29 10:30:01 作者: rapoo

时间格式转为毫秒

?

sbSql.append(" select createdate + ( select period/1000/3600/24 from mass_app_period p where version=? ").append(" ) odate from cdml_sensky_user@ORA72_101_WAPLAT.US.ORACLE.COM where id=? ")

long olddate = rs.getTimestamp("odate").getTime(); long currentDate = System.currentTimeMillis();//当前时间

?

import java.text.ParseException;import java.text.SimpleDateFormat;public class Cat {public static void main(String[] args) throws ParseException {String str = "201104141302";SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmm");long millionSeconds = sdf.parse(str).getTime();//毫秒System.out.println(millionSeconds);}}

读书人网 >编程

热点推荐