一样,app报Model not found,网页版Something went wrong. If this issue persists please contact us through our help center at help.openai.com.
用这个油猴脚本可以解决 // ==UserScript== // @name ChatGPT - Los Angeles Timezone // @name:zh-CN ChatGPT 洛杉矶时区模拟 // @namespace https://chatgpt.com/ // @version 1.0.0 // @description Make chatgpt.com JavaScript use America/Los_Angeles, including DST. // @match https://chatgpt.com/* // @run-at document-start // @grant none // @sandbox raw // ==/UserScript== (() => { 'use strict'; const TZ = 'America/Los_Angeles'; const NativeDate = Date; const NativeDTF = Intl.DateTimeFormat; const dateProto = NativeDate.prototype; const nativeGetTime = dateProto.getTime; const nativeSetTime = dateProto.setTime; const nativeGetUTCDay = dateProto.getUTCDay; const nativeParse = NativeDate.parse; const DAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; const pad = n => String(n).padStart(2, '0'); // 使用原生格式化器,避免递归调用 const partsFormatter = new NativeDTF('en-US-u-ca-gregory-nu-latn', { timeZone: TZ, year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hourCycle: 'h23' }); const zoneNameFormatter = new NativeDTF('en-US', { timeZone: TZ, timeZoneName: 'long' }); function utcMs(y, month, day, h = 0, min = 0, s = 0, ms = 0) { const d = new NativeDate(0); d.setUTCFullYear(y, month - 1, day); d.setUTCHours(h, min, s, ms); return nativeGetTime.call(d); } let lastTimestamp; let lastParts; function zoned(ts) { if (!Number.isFinite(ts)) return null; if (ts === lastTimestamp) return lastParts; const p = {}; for (const item of partsFormatter.formatToParts(new NativeDate(ts))) { if (['year', 'month', 'day', 'hour', 'minute', 'second'].includes(item.type)) { p[item.type] = +item.value; } } p.ms = ((ts % 1000) + 1000) % 1000; p.wall = utcMs(p.year, p.month, p.day, p.hour, p.minute, p.second, p.ms); p.offset = Math.round((ts - p.wall) / 60000); p.weekday = nativeGetUTCDay.call(new NativeDate(utcMs(p.year, p.month, p.day))); lastTimestamp = ts; lastParts = p; return p; } // 将洛杉矶当地时间转换成真实 UTC 时间戳 // 自动处理夏令时切换、重复时间及不存在的时间 function laTimestamp(y, month, day, h = 0, min = 0, s = 0, ms = 0) { y = +y; month = +month; day = +day; h = +h; min = +min; s = +s; ms = +ms; const wall = utcMs(y, month, day, h, min, s, ms); if (!Number.isFinite(wall)) return NaN; const offsets = new Set([ zoned(wall - 172800000)?.offset, zoned(wall)?.offset, zoned(wall + 172800000)?.offset ]); const candidates = [...offsets].filter(Number.isFinite).map(offset => { const instant = wall + offset * 60000; return { instant, wall: zoned(instant)?.wall }; }).filter(c => Number.isFinite(c.wall)); const exact = candidates.filter(c => c.wall === wall) .sort((a, b) => a.instant - b.instant); if (exact.length) return exact[0].instant; const ahead = candidates.filter(c => c.wall > wall) .sort((a, b) => a.wall - b.wall); if (ahead.length) return ahead[0].instant; return candidates[0]?.instant ?? NaN; } // 仅覆盖未显式指定时区的格式化调用 function withTZ(options) { const original = options == null ? {} : Object(options); if (original.timeZone !== undefined) return options; return Object.assign(Object.create(original), { timeZone: TZ }); } // 覆盖 Intl.DateTimeFormat Intl.DateTimeFormat = new Proxy(NativeDTF, { apply(target, thisArg, args) { return Reflect.apply(target, thisArg, [args[0], withTZ(args[1])]); }, construct(target, args, newTarget) { return Reflect.construct(target, [args[0], withTZ(args[1])], newTarget); } }); // 覆盖 Date 本地时间读取接口 const getters = { getFullYear: p => p.year, getMonth: p => p.month - 1, getDate: p => p.day, getDay: p => p.weekday, getHours: p => p.hour, getMinutes: p => p.minute, getSeconds: p => p.second, getMilliseconds: p => p.ms, getTimezoneOffset: p => p.offset, getYear: p => p.year - 1900 }; for (const [method, get] of Object.entries(getters)) { dateProto[method] = function () { const p = zoned(nativeGetTime.call(this)); return p ? get(p) : NaN; }; } function dateString(d) { const p = zoned(nativeGetTime.call(d)); if (!p) return 'Invalid Date'; return `${DAYS[p.weekday]} ${MONTHS[p.month - 1]} ${pad(p.day)} ${p.year}`; } function timeString(d) { const ts = nativeGetTime.call(d); const p = zoned(ts); if (!p) return 'Invalid Date'; const sign = p.offset > 0 ? '-' : '+'; const abs = Math.abs(p.offset); const offset = `GMT${sign}${pad(Math.floor(abs / 60))}${pad(abs % 60)}`; const name = zoneNameFormatter.formatToParts(new NativeDate(ts)) .find(part => part.type === 'timeZoneName')?.value || TZ; return `${pad(p.hour)}:${pad(p.minute)}:${pad(p.second)} ${offset} (${name})`; } dateProto.toDateString = function () { return dateString(this); }; dateProto.toTimeString = function () { return timeString(this); }; dateProto.toString = function () { const date = dateString(this); return date === 'Invalid Date' ? date : `${date} ${timeString(this)}`; }; // 覆盖本地化格式化方法 for (const method of ['toLocaleString', 'toLocaleDateString', 'toLocaleTimeString']) { const original = dateProto[method]; dateProto[method] = function (locales, options) { return original.call(this, locales, withTZ(options)); }; } // 覆盖 Date 本地时间修改接口 const setters = [ 'setFullYear', 'setMonth', 'setDate', 'setHours', 'setMinutes', 'setSeconds', 'setMilliseconds', 'setYear' ]; for (const method of setters) { const original = dateProto[method]; dateProto[method] = function (...args) { const p = zoned(nativeGetTime.call(this)); if (!p && method !== 'setFullYear' && method !== 'setYear') { return original.apply(this, args); } let [y, mo, day, h, min, s, ms] = p ? [p.year, p.month, p.day, p.hour, p.minute, p.second, p.ms] : [1970, 1, 1, 0, 0, 0, 0]; const a = i => args.length > i ? args[i] : undefined; switch (method) { case 'setFullYear': y = a(0); if (args.length > 1) mo = +a(1) + 1; if (args.length > 2) day = a(2); break; case 'setMonth': mo = +a(0) + 1; if (args.length > 1) day = a(1); break; case 'setDate': day = a(0); break; case 'setHours': h = a(0); if (args.length > 1) min = a(1); if (args.length > 2) s = a(2); if (args.length > 3) ms = a(3); break; case 'setMinutes': min = a(0); if (args.length > 1) s = a(1); if (args.length > 2) ms = a(2); break; case 'setSeconds': s = a(0); if (args.length > 1) ms = a(1); break; case 'setMilliseconds': ms = a(0); break; case 'setYear': y = +a(0); if (y >= 0 && y <= 99) y += 1900; break; } return nativeSetTime.call(this, laTimestamp(y, mo, day, h, min, s, ms)); }; } // 解析不带显式时区的 ISO 日期时间字符串 const ISO_LOCAL = /^(\d{4})-(\d\d)-(\d\d)[T ](\d\d):(\d\d)(?::(\d\d)(?:\.(\d+))?)?$/; function parseLocal(value) { if (typeof value !== 'string') return null; const m = ISO_LOCAL.exec(value); if (!m) return null; const milliseconds = m[7] ? +(m[7] + '000').slice(0, 3) : 0; return laTimestamp( +m[1], +m[2], +m[3], +m[4], +m[5], +(m[6] || 0), milliseconds ); } // 覆盖全局 Date 构造器 const FakeDate = new Proxy(NativeDate, { apply() { return dateProto.toString.call(new NativeDate()); }, construct(target, args, newTarget) { if (args.length >= 2) { let year = +args[0]; if (year >= 0 && year <= 99) year = Math.trunc(year) + 1900; const val = i => args.length > i ? args[i] : (i === 2 ? 1 : 0); const ts = laTimestamp( year, +args[1] + 1, val(2), val(3), val(4), val(5), val(6) ); return Reflect.construct(target, [ts], newTarget); } if (args.length === 1) { const ts = parseLocal(args[0]); if (ts !== null) return Reflect.construct(target, [ts], newTarget); } return Reflect.construct(target, args, newTarget); } }); FakeDate.parse = function (value) { const ts = parseLocal(value); return ts === null ? nativeParse.call(NativeDate, value) : ts; }; window.Date = FakeDate; })();
一样,app报Model not found,网页版Something went wrong. If this issue persists please contact us through our help center at help.openai.com.
只能等官方修复了,清缓存重登、修改语言、修改时区都没用,现在chat用不了,work能用。
我以为是我网络的问题呢,原来是官方的问题
用这个油猴脚本可以解决