HomePhabricator

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

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

Event Timeline