Skip to content

Commit 7d80ebb

Browse files
committed
chore: time fix
1 parent 024a9e2 commit 7d80ebb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
function unixToReadable(unix) {
2-
return new Date(unix * 1000).toISOString().slice(0, 19).replace('T', ' ');
2+
return new Date(unix * 1000).toLocaleString('zh-CN', {
3+
year: 'numeric',
4+
month: '2-digit',
5+
day: '2-digit',
6+
hour: '2-digit',
7+
minute: '2-digit',
8+
});
39
}
410

511
export { unixToReadable };

0 commit comments

Comments
 (0)