Files
moeka-project/docs/.vitepress/utils/utils.ts
T
2026-08-26 19:49:58 +08:00

17 lines
287 B
TypeScript

export function formatDate(raw: string): {
string: string
time: number
} {
const date = new Date(raw)
date.setUTCHours(12)
return {
string: date.toLocaleDateString('en-US', {
day: 'numeric',
month: 'long',
year: 'numeric',
}),
time: +date,
}
}