Commit ef754b61 by 余根龙

增加fast

parent a1a9ccb3
...@@ -222,10 +222,16 @@ public class DateUtils { ...@@ -222,10 +222,16 @@ public class DateUtils {
return time; return time;
} }
/**
* 日期转时间戳
*
* @param s
* @return
*/
public static Long dateToStamp(String s){ public static Long dateToStamp(String s){
try { try {
String res; String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timeFormat);
Date date = simpleDateFormat.parse(s); Date date = simpleDateFormat.parse(s);
long ts = date.getTime(); long ts = date.getTime();
return ts; return ts;
...@@ -234,6 +240,17 @@ public class DateUtils { ...@@ -234,6 +240,17 @@ public class DateUtils {
} }
} }
/**
* 时间戳转日期(yyyy-MM-dd HH:mm:ss)
*
* @param timestamp
* @return
*/
public static String stampToTime(String timestamp){
SimpleDateFormat sdf=new SimpleDateFormat(timeFormat);
long date_temp = Long.valueOf(timestamp);
return sdf.format(new Date(date_temp));
}
/** /**
* 判断时间是否在当前时间十分钟之类 * 判断时间是否在当前时间十分钟之类
......
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