Unfucked.DateTime
v0.0.1-beta.5Pre-release
.NETStandard2.0
Fix egregiously broken or missing functionality in NodaTime.
Published
Apr 6, 2026
6mo ago
Total Downloads
10.4K
10,384
Install
dotnet add package Unfucked.DateTime --version 0.0.1-beta.5
| Product | Versions |
|---|---|
| .NET Standard |
README
🧰 Unfucked.DateTime
Fix egregiously missing functionality in NodaTime. Inspired by Joda-Time.
Installation
dotnet package add Unfucked.DateTime
using Unfucked;
Usage
- Absolute value of a
DurationZonedDateTime a, b; Duration abs = (a - b).Abs(); - Get midnight from a
ZonedDateTimeas aZonedDateTime,Period, orDurationZonedDateTime now = SystemClock.Instance.InTzdbSystemDefaultZone().GetCurrentZonedDateTime(); ZonedDateTime midnight = now.AtStartOfDay(); Duration sinceMidnight = now.LocalDateTime.TimeOfDay.ToDurationSinceStartOfDay(); Period sinceMidnight2 = now.LocalDateTime.TimeOfDay.ToPeriodSinceStartOfDay(); - Convert time zone offset to hours
double hours = DateTimeZoneProviders.Tzdb["America/Los_Angeles"].GetUtcOffset(SystemClock.Instance.GetCurrentInstant()).ToHours(); - Compare two
OffsetDateTimesto see which one happens firstOffsetDateTime a, b; bool isBefore = a.IsBefore(b); isBefore = !b.IsAfter(a); - More succinct and interchangeable way to define standard
TimeSpan,Period, andDurationinstances by force casting integral numbers to or constructingMilliseconds,Seconds,Minutes,Hours, andDays, all of which implicitly convert toTimeSpan,Period, andDurationTimeSpan t = (Seconds) 3;
All Unfucked libraries
Changes from Previous Version
No structural changes between v0.0.1-beta.4 and v0.0.1-beta.5.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.
