MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / parseLocalTime

Function parseLocalTime

packages/parser/src/formats/qq-native-txt.ts:116–120  ·  view source on GitHub ↗

* 解析本地时间字符串为秒级时间戳 * @param timeStr 格式:2019-07-16 18:15:05

(timeStr: string)

Source from the content-addressed store, hash-verified

114 * @param timeStr 格式:2019-07-16 18:15:05
115 */
116function parseLocalTime(timeStr: string): number {
117 // 直接用 Date 解析,会按本地时区处理
118 const date = new Date(timeStr.replace(' ', 'T'))
119 return Math.floor(date.getTime() / 1000)
120}
121
122// ==================== 昵称清理 ====================
123

Callers 1

parseTxtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected