Export timestamps shift by the server's UTC offset
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 86/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- bun, sqlite, typescript
Direzione di ricerca
Leggi packages/contract/src/export-columns.ts e packages/api/src/lib/datetime.ts, in particolare formatTimestamp e parseStoredTimestamp. Aggiungi un test per un timestamp memorizzato senza fuso orario, impostando il fuso orario del processo su un fuso diverso da UTC, ed esegui i test pertinenti del formatter. Il lavoro è completato quando i timestamp esportati corrispondono all’ora UTC memorizzata in tutti i fusi orari.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
On a server whose clock isn't set to UTC, the created and last_updated columns in exports are shifted by the server's UTC offset. On a machine set to US Pacific time, a Container stored as created at 2026-11-29 16:46:31 (UTC) exports as 2026-11-30T00:46:31.000Z, 8 hours late.
The web export and the Claude Code export share the same code and both show the shift. It happens on main, so #161 didn't introduce it.
Cause
Timestamps are stored as UTC text with no time zone (YYYY-MM-DD HH:MM:SS, from toStoredTimestamp in packages/api/src/lib/datetime.ts). formatTimestamp in packages/contract/src/export-columns.ts runs new Date(value) on that text, and JavaScript reads text in that form as local time. parseStoredTimestamp in datetime.ts already handles this by adding Z, but the contract formatter doesn't use it.
formatDateOnly in the same file falls back to new Date(value) the same way, but the earlier regex catches stored values first, so it probably doesn't shift in practice.
How to reproduce
- On a Mac set to Pacific time, seed a demo database:
DATABASE_PATH=/tmp/demo.sqlite bun packages/api/src/lib/demo-seed.ts. - Start the API on that database, log in as
admin, and requestGET /api/export/containers?study=DEMO01&format=csv. - Compare the
createdcolumn withselect created from storage_containerin the database.
Fix
Read stored timestamps as UTC in formatTimestamp, the same way parseStoredTimestamp does. Add a test that pins the result for a zoneless value, with the process time zone set to somewhere other than UTC.
Who it affects
Any instance whose server clock isn't set to UTC. Docker images usually run in UTC, so a containerized deployment may not show it. Local development on a laptop does.
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 0
- Merge medio
- 8g 47m
- PR unite (30g)
- 3
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di EPPIcenter/sampledb3
-
JOSS paper outlineApertawayfinder:prototype
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
EPPIcenter/sampledb3#85 ·
-
wayfinder:prototype
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
EPPIcenter/sampledb3#84 ·
-
ready-for-human
Difficoltà 4/5 1-2 giorni Idoneità per principianti 15/100
EPPIcenter/sampledb3#160 · 1 commento ·
-
ready-for-human
Difficoltà 3/5 Mezza giornata Idoneità per principianti 15/100
EPPIcenter/sampledb3#159 ·
-
User guide: Use SampleDB from Claude CodeForse già presa @m-murphy l’ha presa 4 giorni fa. Apertaready-for-agent
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
EPPIcenter/sampledb3#158 ·
Tutte le issue di EPPIcenter/sampledb3
Issue simili
-
enhancement feature/signals self-driving team/self-driving
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PostHog/posthog#144208 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue web
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
triage: not actionable
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
oxc-project/oxc#30518 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug Claude useability
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
wazuh/wazuh-dashboard-plugins#9751 ·
I maintainer di solito rispondono entro 1 giorno