Expreszo.DateTime 0.6.0

dotnet add package Expreszo.DateTime --version 0.6.0
                    
NuGet\Install-Package Expreszo.DateTime -Version 0.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Expreszo.DateTime" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Expreszo.DateTime" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Expreszo.DateTime" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Expreszo.DateTime --version 0.6.0
                    
#r "nuget: Expreszo.DateTime, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Expreszo.DateTime@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Expreszo.DateTime&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Expreszo.DateTime&version=0.6.0
                    
Install as a Cake Tool

Expreszo.DateTime

Optional date/time functions for the Expreszo expression evaluator — 76 functions covering parsing, formatting, arithmetic, comparison, ranges, and relative-to-now helpers. Backed by the BCL (DateTimeOffset + TimeZoneInfo) with no external dependencies, and Native AOT / trim compatible. A faithful port of the TypeScript @pro-fa/expreszo-datetime plugin.

Install

dotnet add package Expreszo.DateTime

Expreszo comes in transitively. Targets net10.0.

Register

using Expreszo;
using Expreszo.DateTimes;

var parser = Parser.WithPlugins([new ExpreszoDateTimePlugin()]);

parser.Evaluate("format(addDuration('2026-01-01', 7, 'days'), 'yyyy-MM-dd')");
// => Value.String "2026-01-08"

The package/assembly is Expreszo.DateTime; the code namespace is Expreszo.DateTimes (plural) so it doesn't shadow System.DateTime.

Configure the clock and zone

Impure functions (now, today, age, distance/relative helpers) read a clock, and zone-less values use a "local" zone — both configurable, which is handy for deterministic tests:

var plugin = new ExpreszoDateTimePlugin(new DateTimeOptions
{
    NowProvider = () => DateTimeOffset.Parse("2026-04-15T12:00:00Z"),
    DefaultZone = TimeZoneInfo.Utc,
});
var parser = Parser.WithPlugins([plugin]);
parser.Evaluate("daysUntil('2026-04-20T12:00:00Z')"); // => 5

Input shapes

Date arguments accept a Value.DateTime, an ISO 8601 string, a Unix-millisecond number, or a native System.DateTime/DateTimeOffset passed via the variable resolver (DateTimeVariables.FromObjects). DateTime values also flow through the core comparison operators (==, <, >=, …) by instant.

Documentation

Full guide and function reference: https://pro-fa.github.io/expreszo-dotnet/datetime-plugin/

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 173 6/26/2026