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
Unknown Object (File)
Mon, Jun 9, 1:54 AM
Unknown Object (File)
May 10 2025, 12:50 AM
Unknown Object (File)
May 9 2025, 4:40 PM
Unknown Object (File)
May 7 2025, 5:04 AM
Unknown Object (File)
May 1 2025, 11:46 PM
Unknown Object (File)
Apr 21 2025, 3:10 PM
Unknown Object (File)
Apr 5 2025, 10:48 AM
Unknown Object (File)
Mar 22 2025, 1:21 AM
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