Hi, im really new to orthanc,
I was hoping someone could advise me on this possible error/bug?
Ive installed orthanc in 2 different PC,
And attempt to query retrieve from 3 different pacs.
both orthanc system seems to get dates for “today” and " yesterday" wrong by a day.
Eg, It is now 15th March, but upon searching for studies done “today”, it shows studies done on 14th March. Likewise, searching for studies done on “yesterday” shows studies on done 13th March instead.
When Orthanc1 queries studies done “today” from Orthanc2, its also shows studies done on 14th March (instead of 15th March)
Both system seems to have correct time in Windows.
Any idea if Orthanc has its own clock/date that I should correct?
Thanks in advance.
I’ve set TZ and PGTZ in both my orthanc and postgres containers.
I’ve set timezone for the orthanc and postgres databases (SHOW TIMEZONE shows America/New_York).
If I say ‘date’ inside either container, it shows the right time.
Right now as i write this it’s 9:30PM. And yet, if I search for studies “today”, I get no results for a study done at 6PM. If I search for studies “yesterday”, I see that study - which was in fact done “yesterday” under UTC.
Hmm, the issue seems to actually be on the web side - the dropdown for ‘today’, ‘yesterday’ etc is created in UTC. It still is even if TZ is set - it seems /etc/timezone doesn’t get set?
Found the bug. Sébastien, can you pretty please fix this?
The bug is in query-retrieve.js:
function JavascriptDateToDicom(date) { var s = date.toISOString(); return s.substring(0, 4) + s.substring(5, 7) + s.substring(8, 10); }
toISOString converts a date to UTC. That means that there is a period of time every day that “today” will be wrong. I suspect Sébastien never encountered this because he lives so close to UTC - so there’s only an hour or so - in the middle of the night - that this issue arises for him!