Commit b09ad719 authored by 杨林's avatar 杨林

时间戳转换工具

parent fd8145f8
package tools.timestamp
import java.text.{ParsePosition, SimpleDateFormat}
/**
* @ClassName: qm.qiaomeng.tools
* @Description: 时间戳转换工具
* @Author: LinYoung
* @Date: 2021/4/15
* @Time: 14:46
*/
object TimestampTools {
def date2Timestamp(date: String): Long = {
if (date.isEmpty) {
0
} else {
new SimpleDateFormat("yyyy-MM-dd").parse(date, new ParsePosition(0)).getTime
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment