MaKoDateTimeConverter 1.0.0

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

// Install MaKoDateTimeConverter as a Cake Tool
#tool nuget:?package=MaKoDateTimeConverter&version=1.0.0                

Nuget Package License: MIT

mako_datetime_converter (C#)

.NET nuget package to convert date times between German "Gastag" and "Stromtag", between inclusive and exclusive end dates and combinations of all them. This is relevant for German Marktkommunikation ("MaKo").

There is Golang port of this library: mako_time_converter (go).

Rationale

The German Marktkommunikation ("MaKo") defines some rules regarding date times:

  • you shall communicate end dates as exclusive (which is generally a good idea)
  • you shall use UTC date times with a specified UTC offset (which is a good idea)
  • and you shall always use UTC-offset 0 (a rule with good intentions)
  • in electricity all days start and end at midnight of German local time
  • but in gas all days start and end at 6am German local time ("Gas-Tag")

Now imagine there is an interface between two systems:

  • one of your systems obeys all of the above rules
  • but another one works differently (e.g. models end dates inclusively or is unaware of the differences between electricity and gas)

Then you need a conversion logic for your date times. This library does the conversion for you.

This library does not convert date times to/from UTC. It expects your application to work with DateTimeKind.Utc only, because everything else is doomed to fail and fixing your timezone problems is out of scope for this library.

How to use this Library

See the minimal working example.

Nuget Packages

This repository is available as nuget package:

Code Quality / Production Readiness

  • The code has a 100% unit test coverage. ✔️
  • The package has no dependencies itself. ✔️

Release Workflow

To create a pre-release nuget package, create a tag of the form prerelease-vx.y.z where x.y.z is the semantic version of the pre-release. This will create and push nuget packages with the specified version x.y.z and a -betaYYYYMMDDHHmmss suffix.

To create a release nuget package, create a tag of the form vx.y.z where x.y.z is the semantic version of the release. This will create and push nuget packages with the specified version x.y.z.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
1.0.0 69 2/10/2025
0.2.2 50,530 8/7/2023
0.2.0 264 2/27/2023
0.1.7 1,606 12/8/2022
0.1.6 23,686 11/15/2022
0.1.5 336 11/15/2022
0.1.4 5,625 9/19/2022
0.1.3 839 9/19/2022
0.1.2 450 9/19/2022
0.1.1 465 9/19/2022
0.1.0 459 9/19/2022
0.0.3 450 9/19/2022
0.0.2-beta20220919121542 189 9/19/2022