Homec4science

Implement a basic `phutil_units()` function for writing "30 days in seconds"…

Authored by epriestley <git@epriestley.com> on Feb 3 2014, 19:37.

Description

Implement a basic phutil_units() function for writing "30 days in seconds" readably

Summary:
Fixes T4325. We have a fair amount of (60 * 60 * 24 * 15) // 15 days stuff in the codebase, and at least one of them was wrong (15 hours, when 15 minutes was probably intended). I was about to write some more, so I wrote this instead.

Make these self-documenting and harder to get wrong.

(This function could be more sophisticated, but I think this is the only real use case we hit.)

Test Plan: Added and ran unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4325

Differential Revision: https://secure.phabricator.com/D8126

Details

Committed
epriestley <git@epriestley.com>Feb 3 2014, 19:37
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUe60dca3649f4: Add "%R" to csprintf(), for printing more readable commands
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU57d568ab3cbf: Implement a basic `phutil_units()` function for writing "30 days in seconds"… (authored by epriestley <git@epriestley.com>).Feb 3 2014, 19:37