Atin Documentation
Atin is a lightweight .NET library for parsing, formatting, and manipulating alphanumeric time interval notations (e.g. D1, H3, M5, W2H1S10).
Design Principles
- Standardized Notation: Express time spans succinctly using intuitive unit-quantity pairs (
Wfor weeks,Dfor days,Hfor hours,Mfor minutes,Sfor seconds). - Broad Compatibility: Targets
netstandard2.0so it can be consumed seamlessly across .NET Framework, .NET Core, and modern .NET. - High Performance: Allocation-friendly parsing and formatting converting directly to and from standard
System.TimeSpan. - Time Manipulation: Comprehensive rounding helpers (
RoundTo,RoundDown,RoundUp) for bothTimeSpanandDateTimeOffset.
Installation
Install the NuGet package:
dotnet add package Atin
Quick Navigation
- API Reference - Full reference documentation for all types and extension methods.
- GitHub Repository - Source code, issues, and discussions.
Overview of Features
| Feature | Description | Key APIs |
|---|---|---|
| Parsing | Convert ATIN strings into TimeSpan |
AtinParser.Parse, AtinParser.TryParse |
| Formatting | Convert TimeSpan into standard ATIN string representations |
TimeSpan.ToAtin() |
| TimeSpan Rounding | Round TimeSpan up, down, or to nearest interval |
TimeSpan.RoundTo, RoundDown, RoundUp |
| DateTimeOffset Rounding | Round DateTimeOffset timestamps to intervals |
DateTimeOffset.RoundTo, RoundDown, RoundUp |