MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getDateByTimezone

Method getDateByTimezone

goodnight/goodnight.ts:214–220  ·  view source on GitHub ↗
(timezoneOffset: number)

Source from the content-addressed store, hash-verified

212 // 辅助函数:检查关键词(完全匹配)
213 private checkKeywords(text: string, keywords: string[]): boolean {
214 return keywords.includes(text);
215 }
216
217 // 辅助函数:根据时区偏移获取 Date 对象
218 private getDateByTimezone(timezoneOffset: number): Date {
219 const now = new Date();
220 // 获取当前 UTC 时间戳
221 const utcTime = now.getTime() + (now.getTimezoneOffset() * 60000);
222 // 加上目标时区偏移 (小时 * 60 * 60 * 1000)
223 return new Date(utcTime + (timezoneOffset * 3600000));

Callers 2

handleCommandMethod · 0.95
processGreetingMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected