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

Function createUtcTimestamp

packages/parser/src/formats/google-chat-takeout.ts:111–132  ·  view source on GitHub ↗
(
  year: number,
  monthIndex: number,
  day: number,
  hour: number,
  minute: number,
  second: number
)

Source from the content-addressed store, hash-verified

109}
110
111function createUtcTimestamp(
112 year: number,
113 monthIndex: number,
114 day: number,
115 hour: number,
116 minute: number,
117 second: number
118): number | null {
119 const timestampMs = Date.UTC(year, monthIndex, day, hour, minute, second)
120 const date = new Date(timestampMs)
121 if (
122 date.getUTCFullYear() !== year ||
123 date.getUTCMonth() !== monthIndex ||
124 date.getUTCDate() !== day ||
125 date.getUTCHours() !== hour ||
126 date.getUTCMinutes() !== minute ||
127 date.getUTCSeconds() !== second
128 ) {
129 return null
130 }
131 return Math.floor(timestampMs / 1000)
132}
133
134function parseChineseUtcDate(value: string): number | null {
135 const match = normalizeSpaces(value).match(

Callers 2

parseChineseUtcDateFunction · 0.85
parseEnglishUtcDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected