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

Clarify meaning of dates given on the command line #513

Open
lars-t-hansen opened this issue Jun 10, 2024 · 0 comments
Open

Clarify meaning of dates given on the command line #513

lars-t-hansen opened this issue Jun 10, 2024 · 0 comments
Labels
component:sonalyze sonalyze/* task:enhancement New feature or request task:ux User experience, both web and command line

Comments

@lars-t-hansen
Copy link
Collaborator

(See also #507, and probably others.)

With the rewrite of sonalyze, the usage of timestamps internally has become tidier - internal times are always UTC, and the date key used in the database is also UTC. But we need to be clearer about the meaning of timestamps used on the command line in --from and --to, and ditto in the job query form. This will require documentation minimally and probably some code.

Related, what is the precise meaning of eg 1d and other relative timestamps used on the command line?

Most sensibly the dates given on the command line should be interpreted as localtime, and 1d is "one day before now, local time". Any conversion to utc to make things work out happens internally. (This creates a mismatch in that the output from reports and so on usually are UTC, but that is a bug in its own right and should not be compounded by contorting ourselves on input.) For timestamps, and power users, it may be interesting to allow the use of an explicit utc suffix Z, ie --from 2024-06-01Z would look in the database starting from that day, while --from 2024-06-01 would start with 05/31 b/c the implied time of the latter timestamp is 2024-06-01T00:00:00+02:00 which is normalized as 2024-05-31T22:00:00Z.

@lars-t-hansen lars-t-hansen added task:enhancement New feature or request task:ux User experience, both web and command line component:sonalyze sonalyze/* labels Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:sonalyze sonalyze/* task:enhancement New feature or request task:ux User experience, both web and command line
Projects
None yet
Development

No branches or pull requests

1 participant