.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).
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.
See the minimal working example.
This repository is available as nuget package:
MaKoDateTimeConverter
for the core functionalities
- The code has a 100% unit test coverage. ✔️
- The package has no dependencies itself. ✔️
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
.