mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
clean up time_ago()
Co-authored-by: Doug Freed <dwfreed@mtu.edu>
This commit is contained in:
parent
201296a0da
commit
ee12134812
@ -146,16 +146,12 @@ static char *time_ago(time_t seconds)
|
|||||||
|
|
||||||
seconds = time(NULL) - seconds;
|
seconds = time(NULL) - seconds;
|
||||||
|
|
||||||
years = seconds/(86400*365);
|
years = seconds / (86400 * 365);
|
||||||
seconds %= (86400*365);
|
seconds %= (86400 * 365);
|
||||||
weeks = seconds/604800;
|
weeks = seconds / 604800;
|
||||||
seconds %= 604800;
|
days = (seconds / 86400) % 7;
|
||||||
days = seconds/86400;
|
hours = (seconds / 3600) % 24;
|
||||||
seconds %= 86400;
|
minutes = (seconds / 60) % 60;
|
||||||
hours = seconds/3600;
|
|
||||||
hours %= 3600;
|
|
||||||
minutes = seconds/60;
|
|
||||||
minutes %= 60;
|
|
||||||
seconds %= 60;
|
seconds %= 60;
|
||||||
|
|
||||||
if (years)
|
if (years)
|
||||||
|
Loading…
Reference in New Issue
Block a user