Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document date is wrong, probable timezone issue #45

Closed
amenk opened this issue Apr 25, 2021 · 6 comments
Closed

Document date is wrong, probable timezone issue #45

amenk opened this issue Apr 25, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@amenk
Copy link

amenk commented Apr 25, 2021

Describe the bug
The date of the document is not matching the date displayed in the app.

To Reproduce
Steps to reproduce the behavior:

  1. Paperless Server runs in timezone Europe/Berlin
  2. Scan a document dated 1.3.2021
  3. View the document in the paperless app
  4. Date Feburary 28, 2021 is displayed

Expected behavior
The date is viewed as March 1, 2021

Screenshots

Paperless-ng server:

ksnip_tmp_pXkOPl

App:

image

Additional information
Paperless App Version: 0.0.10, f-droid
Do you use Paperless NG as a backend: Paperless-ng 1.4.1

Possible cause

It might be because the display timezone is different in the app and the server. Can the app query the server timezone? In the end of the time it's only dates, not date time, so I am not sure if any timezone logic has to take place.

@amenk amenk added the bug Something isn't working label Apr 25, 2021
@jonaswinkler
Copy link

Did you configure PAPERLESS_TIME_ZONE properly?

@amenk
Copy link
Author

amenk commented Apr 25, 2021

Yes it's set to Europe/Berlin on the paperless docker env

@amenk
Copy link
Author

amenk commented Apr 25, 2021

If I do not set this variable and use the UTC default, it works.

@bauerj
Copy link
Owner

bauerj commented Apr 26, 2021

I can reproduce this issue here.

The timestamp comes back from the server as 2021-02-28T23:00:00Z which would be correct for Europe/Berlin. The app currently displays the timestamp in UTC, not the local timezone.

I will change the app behaviour to be consistent with the web interface. However, I'm not sure if this is really what the user expects. If I scan a document in March at home, then travel to London, I don't expect it to show up in February.

@amenk
Copy link
Author

amenk commented Apr 26, 2021

Yeah, time zones are tough and are a headache.

So it would take the time zone from the server? If the sever stays at home it might still show march.

Frequent travelers just should run the sever in UTC ;-) ?

@bauerj
Copy link
Owner

bauerj commented Apr 26, 2021

So it would take the time zone from the server?

No, the local time zone from the OS. Changing the server to UTC just fixed the issue because the app currently assumes the date should be displayed in UTC.

@bauerj bauerj closed this as completed in e1edafd Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants