package com.qianhe.common.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class MtTimeUtil {
    private static final DateTimeFormatter DATA_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    private static final DateTimeFormatter DATA_TIME_FORMATTER_NYR = DateTimeFormatter.ofPattern("yyyy-MM-dd");

    /**
     * LocalDateTime -> String  yyyy-MM-dd HH:mm:ss
     */
    public static String dateTimeFormat(LocalDateTime localDateTime){
        return DATA_TIME_FORMATTER.format(localDateTime);
    }

    /**
     * LocalDateTime -> String  yyyy-MM-dd
     */
    public static String dateTimeFormatNyr(LocalDateTime localDateTime){
        return DATA_TIME_FORMATTER_NYR.format(localDateTime);
    }
}
