Npgsql.NodaTime 9.0.2

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.

Showing the top 20 packages that depend on Npgsql.NodaTime.

Packages Downloads
Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime
NodaTime support plugin for PostgreSQL/Npgsql Entity Framework Core provider.
1
Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime
NodaTime support plugin for PostgreSQL/Npgsql Entity Framework Core provider.
2

.NET 6.0

Version Downloads Last updated
9.0.2 1 01/31/2025
9.0.1 0 11/19/2024
9.0.0 0 11/18/2024
8.0.6 0 11/18/2024
8.0.5 0 10/13/2024
8.0.4 0 09/10/2024
8.0.3 0 05/09/2024
8.0.2 0 02/10/2024
8.0.1 0 12/04/2023
8.0.0 0 11/21/2023
8.0.0-rtm 0 11/20/2023
8.0.0-rc.2 0 10/11/2023
8.0.0-preview.4 0 05/17/2023
8.0.0-preview.3 0 04/24/2023
8.0.0-preview.2 0 03/20/2023
8.0.0-preview.1 0 03/03/2023
7.0.9 0 11/18/2024
7.0.8 0 09/10/2024
7.0.7 0 05/09/2024
7.0.6 0 09/14/2023
7.0.4 0 04/24/2023
7.0.2 0 02/15/2023
7.0.1 0 12/17/2022
7.0.0 0 11/09/2022
7.0.0-rc.2 0 10/11/2022
7.0.0-rc.1 0 09/16/2022
7.0.0-preview.7 0 08/09/2022
7.0.0-preview.6 0 07/13/2022
7.0.0-preview.5 0 06/19/2022
7.0.0-preview.4 0 05/11/2022
7.0.0-preview.3 0 04/19/2022
7.0.0-preview.2 0 03/16/2022
7.0.0-preview.1 0 02/17/2022
6.0.13 0 11/18/2024
6.0.12 0 09/10/2024
6.0.11 0 05/09/2024
6.0.10 0 09/14/2023
6.0.9 0 02/15/2023
6.0.8 0 12/17/2022
6.0.7 0 09/16/2022
6.0.6 0 08/04/2022
6.0.5 0 06/19/2022
6.0.4 0 04/19/2022
6.0.3 0 01/27/2022
6.0.2 0 12/20/2021
6.0.1 0 12/03/2021
6.0.0 0 11/09/2021
6.0.0-rc.2 0 10/14/2021
6.0.0-rc.1 0 09/24/2021
6.0.0-preview7 0 08/16/2021
6.0.0-preview6 0 07/31/2021
6.0.0-preview5 0 07/01/2021
6.0.0-preview4 0 05/27/2021
6.0.0-preview3 0 04/15/2021
6.0.0-preview2 0 03/11/2021
5.0.18 0 05/09/2024
5.0.17 0 09/14/2023
5.0.16 0 02/15/2023
5.0.15 0 09/16/2022
5.0.14 0 06/19/2022
5.0.13 0 04/26/2022
5.0.12 0 02/01/2022
5.0.11 0 11/12/2021
5.0.10 0 09/15/2021
5.0.7 0 06/13/2021
5.0.5 0 05/11/2021
5.0.4 0 03/25/2021
5.0.3 0 01/26/2021
5.0.2 0 01/19/2021
5.0.1.1 0 12/12/2020
5.0.0 0 11/15/2020
5.0.0-preview1.1 0 10/13/2020
5.0.0-alpha1 0 06/17/2020
4.1.14 0 05/18/2024
4.1.13 0 05/09/2024
4.1.12 0 06/19/2022
4.1.11 0 04/26/2022
4.1.9 0 04/06/2021
4.1.8 0 01/21/2021
4.1.7 0 12/12/2020
4.1.6 0 11/15/2020
4.1.5 0 09/28/2020
4.1.4 0 07/19/2020
4.1.3 0 01/31/2020
4.1.2 0 11/14/2019
4.1.1 0 10/02/2019
4.1.0 0 09/26/2019
4.1.0-preview2 0 09/04/2019
4.1.0-preview1 0 08/15/2019
4.0.17 0 06/10/2024
4.0.16 0 05/18/2024
4.0.15 0 05/18/2024
4.0.14 0 05/09/2024
4.0.13 0 06/19/2022
4.0.11 0 07/19/2020
4.0.10 0 09/09/2019
4.0.9 0 08/14/2019
4.0.8 0 07/18/2019
4.0.7 0 05/21/2019
4.0.6 0 04/11/2019
4.0.5 0 03/03/2019
4.0.4 0 12/06/2018
1.0.0 0 05/30/2018
1.0.0-rc1 0 05/08/2018
1.0.0-preview1 0 03/22/2018