mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-21 16:26:49 +08:00
init
This commit is contained in:
16
app/utils/custom.ts
Normal file
16
app/utils/custom.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export function getCurrentTime(): string {
|
||||
const now = new Date();
|
||||
const formatter = new Intl.DateTimeFormat("zh-CN", {
|
||||
timeZone: "Asia/Shanghai", // 设置为中国标准时间
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
});
|
||||
|
||||
// console.log(formattedDateTime); // 输出中国标准时间格式
|
||||
|
||||
return formatter.format(now);
|
||||
}
|
||||
Reference in New Issue
Block a user