Npgsql.NodaTime 9.0.3

Prefix Reserved
dotnet add package Npgsql.NodaTime --version 9.0.3                
NuGet\Install-Package Npgsql.NodaTime -Version 9.0.3                
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="9.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Npgsql.NodaTime --version 9.0.3                
#r "nuget: Npgsql.NodaTime, 9.0.3"                
#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.
// Install Npgsql.NodaTime as a Cake Addin
#addin nuget:?package=Npgsql.NodaTime&version=9.0.3

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

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, add a dependency on this package and create a NpgsqlDataSource. Once this is done, you can use NodaTime types when interacting with PostgreSQL, just as you would use e.g. DateTime:

using Npgsql;

var dataSourceBuilder = new NpgsqlDataSourceBuilder(ConnectionString);

dataSourceBuilder.UseNodaTime();

var dataSource = dataSourceBuilder.Build();
var conn = await dataSource.OpenConnectionAsync();

// 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 Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (18)

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

Package Downloads
Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime

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.

Lobster.Boot

LobsterBoot核心类库

GitHub repositories (6)

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

Repository Stars
JasperFx/marten
.NET Transactional Document DB and Event Store on PostgreSQL
linq2db/linq2db
Linq to database provider.
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
9.0.3 50,966 2/24/2025
9.0.2 183,072 12/7/2024
9.0.1 50,695 11/19/2024
9.0.0 5,857 11/18/2024
8.0.7 1,696 2/24/2025
8.0.6 175,059 11/18/2024
8.0.5 309,824 10/13/2024
8.0.4 126,187 9/10/2024
8.0.3 815,796 5/9/2024
8.0.2 341,647 2/10/2024
8.0.1 60,794 12/4/2023
8.0.0 347,020 11/21/2023
8.0.0-rtm 137 11/20/2023
8.0.0-rc.2 13,873 10/11/2023
8.0.0-preview.4 9,365 5/17/2023
8.0.0-preview.3 415 4/24/2023
8.0.0-preview.2 510 3/20/2023
8.0.0-preview.1 612 3/3/2023
7.0.10 135 3/17/2025
7.0.9 2,261 11/18/2024
7.0.8 2,396 9/10/2024
7.0.7 39,422 5/9/2024
7.0.6 426,546 9/14/2023
7.0.4 518,199 4/24/2023
7.0.2 480,709 2/15/2023
7.0.1 349,718 12/17/2022
7.0.0 86,538 11/9/2022
7.0.0-rc.2 3,970 10/11/2022
7.0.0-rc.1 1,095 9/16/2022
7.0.0-preview.7 2,361 8/9/2022
7.0.0-preview.6 866 7/13/2022
7.0.0-preview.5 632 6/19/2022
7.0.0-preview.4 915 5/11/2022
7.0.0-preview.3 741 4/19/2022
7.0.0-preview.2 535 3/16/2022
7.0.0-preview.1 525 2/17/2022
6.0.13 2,805 11/18/2024
6.0.12 3,466 9/10/2024
6.0.11 42,943 5/9/2024
6.0.10 80,377 9/14/2023
6.0.9 113,617 2/15/2023
6.0.8 248,061 12/17/2022
6.0.7 369,785 9/16/2022
6.0.6 479,581 8/4/2022
6.0.5 227,209 6/19/2022
6.0.4 344,505 4/19/2022
6.0.3 397,426 1/27/2022
6.0.2 264,491 12/20/2021
6.0.1 315,897 12/3/2021
6.0.0 103,454 11/9/2021
6.0.0-rc.2 1,439 10/14/2021
6.0.0-rc.1 1,437 9/24/2021
6.0.0-preview7 2,373 8/16/2021
6.0.0-preview6 818 7/31/2021
6.0.0-preview5 1,607 7/1/2021
6.0.0-preview4 870 5/27/2021
6.0.0-preview3 854 4/15/2021
6.0.0-preview2 13,438 3/11/2021
5.0.18 934 5/9/2024
5.0.17 1,045 9/14/2023
5.0.16 514 2/15/2023
5.0.15 720 9/16/2022
5.0.14 1,497 6/19/2022
5.0.13 1,083 4/26/2022
5.0.12 17,248 2/1/2022
5.0.11 68,446 11/12/2021
5.0.10 326,431 9/15/2021
5.0.7 306,024 6/13/2021
5.0.5 92,557 5/11/2021
5.0.4 254,723 3/25/2021
5.0.3 148,732 1/26/2021
5.0.2 204,575 1/19/2021
5.0.1.1 64,992 12/12/2020
5.0.0 33,689 11/15/2020
5.0.0-preview1.1 4,468 10/13/2020
5.0.0-alpha1 677 6/17/2020
4.1.14 315 5/18/2024
4.1.13 216 5/9/2024
4.1.12 4,305 6/19/2022
4.1.11 1,108 4/26/2022
4.1.9 80,620 4/6/2021
4.1.8 77,541 1/21/2021
4.1.7 1,362 12/12/2020
4.1.6 166,113 11/15/2020
4.1.5 92,427 9/28/2020
4.1.4 149,433 7/19/2020
4.1.3 437,448 1/31/2020
4.1.2 104,684 11/14/2019
4.1.1 57,891 10/2/2019
4.1.0 9,899 9/26/2019
4.1.0-preview2 2,857 9/4/2019
4.1.0-preview1 1,436 8/15/2019
4.0.17 239 6/10/2024
4.0.16 137 5/18/2024
4.0.15 127 5/18/2024
4.0.14 140 5/9/2024
4.0.13 524 6/19/2022
4.0.11 634 7/19/2020
4.0.10 39,255 9/9/2019
4.0.9 11,027 8/14/2019
4.0.8 2,546 7/18/2019
4.0.7 128,541 5/21/2019
4.0.6 2,201 4/11/2019
4.0.5 11,917 3/3/2019
4.0.4 69,284 12/6/2018
1.0.0 193,058 5/30/2018
1.0.0-rc1 1,755 5/8/2018
1.0.0-preview1 3,036 3/22/2018