DateTimeMate is a new open-source Golang package and CLI tool I've developed to tackle common date and time manipulation challenges. It's designed to provide a robust, flexible solution for developers working with temporal data in Go or directly from the command line.<p>Key features:<p>* Precise duration calculations between arbitrary dates/times<p>* Date/time arithmetic with support for complex durations<p>* Periodic calculations with customizable repetition<p>* Flexible unit conversion for durations<p>* Date/time reformatting<p>___<p>The CLI tool, dtmate, offers commands that mirror these core functionalities:<p>diff: Calculate time differences<p>dur: Perform date/time arithmetic<p>conv: Convert between duration units<p>fmt: Reformat date/time strings<p>___<p>What sets DateTimeMate apart:<p>Intuitive syntax: The CLI accepts human-readable duration formats like "1 year 2 months 3 days 4 hours" as well as brief formats like "1Y2M3D4h".<p>Relative date shortcuts: Supports keywords like "now", "today", "yesterday", "tomorrow" for quick calculations.<p>Flexible unit handling: Converts between various time units, including sub-second precision (milliseconds, microseconds, nanoseconds).<p>Consistent year definition: Uses 365.25 days per year for accurate long-term calculations.<p>Dual-purpose design: Functions both as a standalone CLI tool and an importable Go package.<p>___<p>CLI Example:<p>$ dtmate diff "2023-01-01 12:00:00" "2024-03-15 18:30:45"<p>1 year 2 months 14 days 6 hours 30 minutes 45 seconds<p>$ dtmate dur today "1Y 2M 3W 4D 5h 6m 7s" -a<p>2025-10-19 17:06:07<p>$ dtmate conv 4321s123456789ns hms.msusns<p>1h12m1s123ms456us789ns<p>___<p>I built DateTimeMate to address the complexities often encountered in date/time manipulation, especially when dealing with mixed units or long-term calculations. It's particularly useful for tasks like:<p>* Project timeline calculations<p>* Age computations<p>* Event scheduling and planning<p>* Log analysis and time-based data processing<p>___<p>The project is open-source and available on GitHub: <a href="https://github.com/jftuga/DateTimeMate">https://github.com/jftuga/DateTimeMate</a><p>I'm keen to hear thoughts from the HN community. What other date/time challenges do you face in your projects? How could DateTimeMate be extended to better serve your needs?