Skip to content

FluentDateTime/FluentDateTime

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
September 21, 2023 22:16
September 7, 2023 18:48
March 4, 2022 20:27
January 9, 2020 09:47
September 21, 2023 22:16

FluentDateTime

Build status NuGet Status

Allows cleaner DateTime expressions and operations.

See Milestones for release notes.

Inspired by Ruby DateTime Extensions

NuGet

https://nuget.org/packages/FluentDateTime/

Usage

Here is some examples of use cases

// DateTime operations
DateTime.Now - 1.Weeks() - 3.Days() + 14.Minutes()
DateTime.Now + 5.Years()

// Relative DateTime evaluations
3.Days().Ago()
2.Days().Since(DateTime.Now)

// Fluent DateTime estimations
DateTime.Now.NextDay()
DateTime.Now.NextYear()
DateTime.Now.PreviousYear()
DateTime.Now.WeekAfter()
DateTime.Now.Midnight()
DateTime.Now.Noon()

// Current DateTime manipulation
DateTime.Now.SetTime(11, 55, 0)

// DateTime expressions
2022.Mar(23) // (implicitly convertible to DateTime and DateTimeOffset)
2022.March(23).At(10, 26)

See Unit Tests in the project for more details.

Icon

Calendar from The Noun Project