| | |
| | | package cn.flightfeather.supervision.common.utils |
| | | |
| | | import org.springframework.stereotype.Component |
| | | import java.sql.Timestamp |
| | | import java.text.ParsePosition |
| | | import java.text.SimpleDateFormat |
| | | import java.util.* |
| | | |
| | | @Component |
| | | class DateUtil { |
| | | private val threadLocal = ThreadLocal<SimpleDateFormat>() |
| | | |
| | |
| | | * @return 日期字符串 |
| | | */ |
| | | fun DateToString(date: Date?, pattern: String): String? { |
| | | var dateString: String? = null |
| | | var dateString: String? = "" |
| | | if (date != null) { |
| | | try { |
| | | dateString = getDateFormat(pattern).format(date) |