Files
moeka-project/docs/.vitepress/utils/utils.ts
T
2026-08-26 20:13:10 +08:00

17 lines
287 B
TypeScript

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