Page MenuHomePhabricator

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

Authored by epriestley on Feb 1 2014, 11:03 PM.
Tags
None
Referenced Files
F15472069: D8126.id18382.diff
Sat, Apr 5, 10:48 AM
F15421617: D8126.diff
Sat, Mar 22, 1:21 AM
Unknown Object (File)
Feb 24 2025, 11:27 AM
Unknown Object (File)
Feb 19 2025, 10:21 PM
Unknown Object (File)
Jan 28 2025, 2:58 PM
Unknown Object (File)
Jan 27 2025, 1:34 PM
Unknown Object (File)
Jan 27 2025, 5:21 AM
Unknown Object (File)
Jan 24 2025, 4:20 PM
Subscribers

Details

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.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped