字符串时间转Date格式

青旅半醒 2022-10-02 09:47 301阅读 0赞
  1. /**
  2. * 字符串时间格式转 Date 格式
  3. * @param strDate
  4. * @return
  5. */
  6. public static Date getDateTimeByStringTime(String strDate) {
  7. //如果参数为空,直接返回
  8. if(strDate == null){ return null; }
  9. //
  10. SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  11. ParsePosition pos = new ParsePosition(0);
  12. //
  13. return formatter.parse(strDate, pos);
  14. }

发表评论

表情:
评论列表 (有 0 条评论,301人围观)

还没有评论,来说两句吧...

相关阅读