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

[enh] Human readable date #552

Merged
merged 10 commits into from Dec 12, 2018

Conversation

Projects
None yet
3 participants
@kir0ul
Copy link
Contributor

kir0ul commented Oct 5, 2018

The problem

The command sudo yunohost app listlists prints a not very understandable date, like the following:

yunohost:
  lastUpdate: 1538746930

See issue 901 for more informations.

In general, date are not well managed, this PR try to harmonize the date management.

Solution

Filename containing a date should be in UTC.
Files containing dates should use "aware" date format or naive UTC date to store the date.
If a timestamp is stored it should be convert with utcfromtimestamp .

CLI should display date for human and use the system timezone to display date (See YunoHost/moulinette#184 )

Webadmin should display date in the broser locale timezone (See YunoHost/yunohost-admin#216 )

Info: yunohost logs lines seems use asctime to store dates in system local timezone (without timezone info). I don't know if it's a good idea.

Status

Ready
PR linked to
YunoHost/yunohost-admin#216
YunoHost/moulinette#184

How to test

@zamentur

This comment has been minimized.

Copy link
Contributor

zamentur commented Oct 10, 2018

We discussed this during the pycon fr. I think we should consider make this change by default (without option -H) and give a date (as moulinette and yunohost-admin contains a code to transmit date through API).

We could add an option to get the timestamp but i think it's not necessary.

The goal of this change is to give the better UX has possible by default.

I can implement this change if others are agree. @kiroul, feel free to do it if you have time :)

@alexAubin

This comment has been minimized.

Copy link
Member

alexAubin commented Oct 24, 2018

I can implement this change if others are agree. @kiroul, feel free to do it if you have time :)

Yes, please anybody go ahead with this :P

@alexAubin alexAubin added this to the 3.3.x milestone Oct 24, 2018

@alexAubin

This comment has been minimized.

Copy link
Member

alexAubin commented Nov 23, 2018

(Bump @zamentur )

@alexAubin alexAubin modified the milestones: 3.3.x, 3.4.x Nov 23, 2018

@kir0ul

This comment has been minimized.

Copy link
Contributor Author

kir0ul commented Nov 26, 2018

@zamentur @alexAubin Sorry for the late answer. I am really busy on other projects right now and I think I probably won't have time to work on this before a few weeks (maybe at Christmas). Sorry about that.

@zamentur zamentur self-assigned this Dec 9, 2018

@zamentur zamentur changed the base branch from stretch-unstable to stretch-testing Dec 9, 2018

@zamentur zamentur changed the base branch from stretch-testing to stretch-unstable Dec 9, 2018

Show resolved Hide resolved src/yunohost/monitor.py Outdated
Show resolved Hide resolved src/yunohost/app.py Outdated
@alexAubin

This comment has been minimized.

Copy link
Member

alexAubin commented on src/yunohost/settings.py in 60843ed Dec 9, 2018

Is the intention to produce a different behavior compared to now(), or is it be just more explicit about what the function returns ? (reading the doc of those, it just seems like it does the same if no arguments are given)

@zamentur

This comment has been minimized.

Copy link
Contributor

zamentur commented Dec 10, 2018

Is the intention to produce a different behavior compared to now(), or is it be just more explicit about what the function returns ? (reading the doc of those, it just seems like it does the same if no arguments are given)

It's different now() return a naive Locale date, utcnow() a naive UTC date.
naive= without tzinfo inside the datetime

@zamentur zamentur added opinion needed and removed work needed labels Dec 10, 2018

@zamentur

This comment has been minimized.

Copy link
Contributor

zamentur commented Dec 10, 2018

Ready and tested

@alexAubin
Copy link
Member

alexAubin left a comment

Tested a few things, LGTM

@alexAubin alexAubin changed the title [#901] Human readable date [enh] Human readable date Dec 10, 2018

@alexAubin alexAubin merged commit bf676c2 into YunoHost:stretch-unstable Dec 12, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment