feat: update

This commit is contained in:
yanghao05
2025-04-18 17:41:31 +08:00
parent 62dd5899e0
commit 4165d440ed
7 changed files with 210 additions and 93 deletions

View File

@@ -0,0 +1,16 @@
import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
// Configure dayjs
dayjs.extend(utc);
dayjs.extend(timezone);
/**
* Format date to locale string with timezone
* @param {string|Date} date - The date to format
* @returns {string} Formatted date string
*/
export function formatDate(date) {
return dayjs.tz(date, 'Asia/Shanghai').format('YYYY-MM-DD HH:mm:ss');
}