LAPTOP-KB9HII50\70708 vor 2 Jahren
Ursprung
Commit
e6e1fe8e02

+ 1 - 20
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -6,8 +6,6 @@ import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
@ -129,25 +127,8 @@ public class DateUtil {
        return ymd != null && ymd.length() == "yyyy-MM-dd".length() ? ymd.substring(0, 4) : null;
    }
    public static String utcToDate(String utcTime, String format) {
        SimpleDateFormat utcSdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
        SimpleDateFormat newSdf = new SimpleDateFormat(format);
        String date = null;
        try {
            if (!org.apache.commons.lang3.StringUtils.isEmpty(utcTime)) {
                date = newSdf.format(utcSdf.parse(utcTime));
            }
        } catch (ParseException var6) {
            var6.printStackTrace();
        }
        return date;
    }
    public static String getCurrentString(String pattern) {
        SimpleDateFormat f = new SimpleDateFormat(pattern);
        return f.format(Calendar.getInstance(TimeZone.getDefault()).getTime());
        return DateTimeFormatter.ofPattern(pattern).format(dateToLocalDateTime(new Date()));
    }
    public static String utcToDate(Date date) {