项目需要将前端传过来的时间字符串转成日期格式,可以使用该方法。 参考链接: https://blog.csdn.net/Michean/article/details/90901450 https://www.jb51.net/article/244302.htm