This commit is contained in:
@@ -187,12 +187,13 @@ export function formatDateTime(
|
||||
|
||||
if (isNaN(d.getTime())) return '-'
|
||||
|
||||
const year = d.getFullYear()
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
const hours = String(d.getHours()).padStart(2, '0')
|
||||
const minutes = String(d.getMinutes()).padStart(2, '0')
|
||||
const seconds = String(d.getSeconds()).padStart(2, '0')
|
||||
// 使用 UTC 方法获取时间
|
||||
const year = d.getUTCFullYear()
|
||||
const month = String(d.getUTCMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getUTCDate()).padStart(2, '0')
|
||||
const hours = String(d.getUTCHours()).padStart(2, '0')
|
||||
const minutes = String(d.getUTCMinutes()).padStart(2, '0')
|
||||
const seconds = String(d.getUTCSeconds()).padStart(2, '0')
|
||||
|
||||
return format
|
||||
.replace('YYYY', String(year))
|
||||
@@ -203,6 +204,7 @@ export function formatDateTime(
|
||||
.replace('ss', seconds)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 格式化费率(基点 -> 百分比)
|
||||
* @param basisPoints 费率基点(100基点=1%)
|
||||
|
||||
Reference in New Issue
Block a user