2024-04-23 13:45:48 +08:00

11 lines
239 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import moment from 'moment'
/**
* 格式化时间
* @param date 传入的时间
* @param format 要转换的格式 例如YYYY-MM-DD HH:mm:ss
* */
export const formatDate = (date, format) => {
return moment(date).format(format)
}