Npgsql.NodaTime 7.0.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
.NET 6.0 .NET Standard 2.0
dotnet add package Npgsql.NodaTime --version 7.0.1
NuGet\Install-Package Npgsql.NodaTime -Version 7.0.1
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="Npgsql.NodaTime" Version="7.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Npgsql.NodaTime --version 7.0.1
#r "nuget: Npgsql.NodaTime, 7.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Npgsql.NodaTime as a Cake Addin
#addin nuget:?package=Npgsql.NodaTime&version=7.0.1

// Install Npgsql.NodaTime as a Cake Tool
#tool nuget:?package=Npgsql.NodaTime&version=7.0.1

Npgsql is the open source .NET data provider for PostgreSQL. It allows you to connect and interact with PostgreSQL server using .NET.

This package is an Npgsql plugin which allows you to use the NodaTime date/time library when interacting with PostgreSQL; this provides a better and safer API for dealing with date and time data.

To use the NodaTime plugin, simply add a dependency on this package and set it up at program startup:

NpgsqlConnection.GlobalTypeMapper.UseNodaTime();

Once this is done, you can simply use NodaTime types when interacting with PostgreSQL, just as you would use e.g. DateTime:

// Write NodaTime Instant to PostgreSQL "timestamp with time zone" (UTC)
using (var cmd = new NpgsqlCommand(@"INSERT INTO mytable (my_timestamptz) VALUES (@p)", conn))
{
    cmd.Parameters.Add(new NpgsqlParameter("p", Instant.FromUtc(2011, 1, 1, 10, 30)));
    cmd.ExecuteNonQuery();
}

// Read timestamp back from the database as an Instant
using (var cmd = new NpgsqlCommand(@"SELECT my_timestamptz FROM mytable", conn))
using (var reader = cmd.ExecuteReader())
{
    reader.Read();
    var instant = reader.GetFieldValue<Instant>(0);
}

For more information, visit the NodaTime plugin documentation page.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Npgsql.NodaTime:

Package Downloads
Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

NodaTime support plugin for PostgreSQL/Npgsql Entity Framework Core provider.

Marten.NodaTime

NodaTime extension for Marten

Rocket.Surgery.Extensions.Marten

Package Description

PostgreSQLCopyHelper.NodaTime

A library for Bulk Copy / Bulk Inserts with PostgreSQL.

NSSL.Deviax.QueryBuilder.Postgres

SQL DSL / Micro ORM - PostgreSQL Driver

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on Npgsql.NodaTime:

Repository Stars
JasperFx/marten
.NET Transactional Document DB and Event Store on PostgreSQL
npgsql/efcore.pg
Entity Framework Core provider for PostgreSQL
PluralKit/PluralKit
PostgreSQLCopyHelper/PostgreSQLCopyHelper
Simple Wrapper around Npgsql for using PostgreSQL COPY functions.
Version Downloads Last updated
7.0.1 27,273 12/17/2022
7.0.0 31,798 11/9/2022
7.0.0-rc.2 3,610 10/11/2022
7.0.0-rc.1 946 9/16/2022
7.0.0-preview.7 1,905 8/9/2022
7.0.0-preview.6 756 7/13/2022
7.0.0-preview.5 535 6/19/2022
7.0.0-preview.4 785 5/11/2022
7.0.0-preview.3 632 4/19/2022
7.0.0-preview.2 428 3/16/2022
7.0.0-preview.1 423 2/17/2022
6.0.8 6,572 12/17/2022
6.0.7 113,858 9/16/2022
6.0.6 214,485 8/4/2022
6.0.5 155,282 6/19/2022
6.0.4 245,840 4/19/2022
6.0.3 221,445 1/27/2022
6.0.2 161,380 12/20/2021
6.0.1 107,350 12/3/2021
6.0.0 66,579 11/9/2021
6.0.0-rc.2 1,149 10/14/2021
6.0.0-rc.1 1,338 9/24/2021
6.0.0-preview7 1,944 8/16/2021
6.0.0-preview6 393 7/31/2021
6.0.0-preview5 794 7/1/2021
6.0.0-preview4 399 5/27/2021
6.0.0-preview3 384 4/15/2021
6.0.0-preview2 7,805 3/11/2021
5.0.15 264 9/16/2022
5.0.14 363 6/19/2022
5.0.13 571 4/26/2022
5.0.12 15,303 2/1/2022
5.0.11 67,572 11/12/2021
5.0.10 294,262 9/15/2021
5.0.7 289,108 6/13/2021
5.0.5 88,933 5/11/2021
5.0.4 213,303 3/25/2021
5.0.3 147,847 1/26/2021
5.0.2 188,879 1/19/2021
5.0.1.1 63,654 12/12/2020
5.0.0 32,649 11/15/2020
5.0.0-preview1.1 4,342 10/13/2020
5.0.0-alpha1 546 6/17/2020
4.1.12 313 6/19/2022
4.1.11 390 4/26/2022
4.1.9 24,052 4/6/2021
4.1.8 50,560 1/21/2021
4.1.7 1,107 12/12/2020
4.1.6 150,717 11/15/2020
4.1.5 75,739 9/28/2020
4.1.4 143,214 7/19/2020
4.1.3 391,302 1/31/2020
4.1.2 89,709 11/14/2019
4.1.1 52,237 10/2/2019
4.1.0 8,970 9/26/2019
4.1.0-preview2 2,263 9/4/2019
4.1.0-preview1 817 8/15/2019
4.0.13 267 6/19/2022
4.0.11 452 7/19/2020
4.0.10 38,276 9/9/2019
4.0.9 10,238 8/14/2019
4.0.8 2,118 7/18/2019
4.0.7 120,486 5/21/2019
4.0.6 1,426 4/11/2019
4.0.5 10,627 3/3/2019
4.0.4 66,238 12/6/2018
1.0.0 188,567 5/30/2018
1.0.0-rc1 896 5/8/2018
1.0.0-preview1 2,747 3/22/2018