`

时间格式转为毫秒

 
阅读更多

 

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);
}
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics