public static java.sql.Timestamp StrTransSqlDate(String date) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date nowDate;
java.sql.Timestamp transdate = null;
try {
nowDate = simpleDateFormat.parse(date); transdate = new java.sql.Timestamp(nowDate.getTime()); } catch (Exception e) {
e.printStackTrace();
}
return transdate;
}
相关文章
- (后端)JackSon将java对象转换为JSON字符串(转)
- 如何将UTF-8转换为Java的unicode ?
- (java office转pdf) MS Office2010、WPS2015、OpenOffice4用Java将Office文档转换为PDF,WIN7 64位系统
- java将日期格式字符串2015-08-05T09:40:00+08:00转换为yyyy-MM-dd HH:mm:ss
- 如何将UTF-8转换为Java的unicode ?
- (java office转pdf) MS Office2010、WPS2015、OpenOffice4用Java将Office文档转换为PDF,WIN7 64位系统