|
@@ -20,6 +20,7 @@ import java.util.*;
|
|
|
@Slf4j
|
|
|
public class DateUtil {
|
|
|
|
|
|
+
|
|
|
//格式化本年
|
|
|
public String getThisYear(){
|
|
|
Calendar cal = Calendar.getInstance();
|
|
@@ -61,6 +62,16 @@ public class DateUtil {
|
|
|
return sdf.format(date);
|
|
|
}
|
|
|
|
|
|
+ //格式化日期
|
|
|
+ public String formatDate(String dateText) throws ParseException {
|
|
|
+ if(dateText.indexOf("T") != -1){
|
|
|
+ dateText = dateText.replace("T"," ");
|
|
|
+ }
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Date date = sdf.parse(dateText);
|
|
|
+ return sdf.format(date);
|
|
|
+ }
|
|
|
+
|
|
|
//
|
|
|
public Date getTodayDate() throws ParseException {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|