|
@@ -209,7 +209,8 @@ public class DateUtil {
|
|
* @author xtwin <br/>
|
|
* @author xtwin <br/>
|
|
* @version 2013-11-27 上午09:59:37 <br/>
|
|
* @version 2013-11-27 上午09:59:37 <br/>
|
|
*/
|
|
*/
|
|
- private static SimpleDateFormat getFormat(String pattern) {
|
|
|
|
|
|
+ private static SimpleDateFormat
|
|
|
|
+ getFormat(String pattern) {
|
|
SimpleDateFormat sdf = formats.get(pattern);
|
|
SimpleDateFormat sdf = formats.get(pattern);
|
|
|
|
|
|
if (null == sdf) {
|
|
if (null == sdf) {
|
|
@@ -247,9 +248,14 @@ public class DateUtil {
|
|
return strtodate;
|
|
return strtodate;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static String parseDateStr(Long times)
|
|
|
|
+ {
|
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ ParsePosition pos = new ParsePosition(0);
|
|
|
|
+ return formatter.format(new Date(times));
|
|
|
|
+ }
|
|
|
|
+
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
- for (int i = 0; i < 20; i++) {
|
|
|
|
- System.out.println(DateUtil.getRandomCurrentTimeStamp());
|
|
|
|
- }
|
|
|
|
|
|
+ System.out.print(parseDateStr(1543766400000l));
|
|
}
|
|
}
|
|
}
|
|
}
|