function i(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e)return e}catch(e){console.warn("Failed to get user system timezone:",e)}return"Asia/Shanghai"}function m(){const e=localStorage.getItem("timezone");return e||i()}function s(e,r,n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}){if(!e)return"—";try{const t=typeof e=="string"?new Date(e):e,o=r||m();return new Intl.DateTimeFormat("zh-CN",{...n,timeZone:o}).format(t)}catch(t){return console.error("Error formatting date:",t),typeof e=="string"?e:e?.toString()||"—"}}export{s as f};
