| | |
| | | |
| | | public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; |
| | | |
| | | public static final String DEFAULT_TIME_ZONE = "Europe/Paris"; |
| | | public static final String DEFAULT_TIME_ZONE = "Asia/Shanghai"; |
| | | |
| | | public static final String NORMAL_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | |
| | | if (format == null || format.isEmpty()) { |
| | | format = "yyyy-MM-dd HH:mm:ss"; |
| | | } |
| | | TimeZone timeZone = TimeZone.getTimeZone("GMT+8"); |
| | | TimeZone timeZone = TimeZone.getTimeZone("Asia/Shanghai"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat(format); |
| | | sdf.setTimeZone(timeZone); |
| | | // 类库使用时候,也保证有个正确结果 |
| | |
| | | if (millisecond == null || millisecond.isEmpty() || millisecond.equals("null")) { |
| | | return ""; |
| | | } |
| | | TimeZone timeZone = TimeZone.getTimeZone("GMT+8"); |
| | | TimeZone timeZone = TimeZone.getTimeZone("Asia/Shanghai"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | sdf.setTimeZone(timeZone); |
| | | return sdf.format(new Date(Long.valueOf(millisecond))); |