GnssCalc 1.0.1

This project is analog of Python's gnsscal package. It provide three most popular GnssDate types such as GpsDate, BdsDate, YearDoY. And, of course, it provide Extensions to type casting.

There is a newer version of this package available.
See the version list below for details.
Install-Package GnssCalc -Version 1.0.1
dotnet add package GnssCalc --version 1.0.1
<PackageReference Include="GnssCalc" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GnssCalc --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GnssCalc, 1.0.1"
For F# scripts that support #r syntax, copy this into the source code to reference the package.

Welcome to the GnssCal wiki!

How to use it? It's simple

Example 1. Cast from DateTime. Use DateTimeExtension.

using GpsTimeCalc.Extensions;
DateTime existedDateTime = new DateTime(2017, 5, 17);
GpsDate gpsDate = existedDateTime.ToGpsTime(); \\ It return GpsDate(weeks: 1949, dayOfweek: 3)
BdsDate bdsDate = existedDateTime.ToBdsTime(); \\ It return BdsDate(weeks: 593, dayOfweek: 3)
YearDoY yearDoY = existedDateTime.ToYearDoY(); \\ It return YearDoY(year: 2017, dayOfyear: 137)

Example 2. Cast from gnssTime types. Explicit cast.

GpsDate gpsDate = new GpsDate(1949, 3);
BdsDate bdsDate = (BdsDate)gpsDate; \\ It return BdsDate(weeks: 593, dayOfweek: 3)
YearDoY yearDoY = (YearDoY)gpsDate; \\ It return YearDoY(year: 2017, dayOfyear: 137)
DateTime dateTime = (DateTime)gpsDate; \\ It return DateTime(2017, 5, 17)

Example 2. Cast from gnssTime types. Cast with extension method

using GpsTimeCalc.Extensions;
GpsDate gpsDate = new GpsDate(1949, 3);
BdsDate bdsDate = gpsDate.ToBdsDate(); \\ It return BdsDate(weeks: 593, dayOfweek: 3)
YearDoY yearDoY = gpsDate.ToYearDoY(); \\ It return YearDoY(year: 2017, dayOfyear: 137)
DateTime dateTime = gpsDate.ToDateTime(); \\ It return DateTime(2017, 5, 17)

Welcome to the GnssCal wiki!

How to use it? It's simple

Example 1. Cast from DateTime. Use DateTimeExtension.

using GpsTimeCalc.Extensions;
DateTime existedDateTime = new DateTime(2017, 5, 17);
GpsDate gpsDate = existedDateTime.ToGpsTime(); \\ It return GpsDate(weeks: 1949, dayOfweek: 3)
BdsDate bdsDate = existedDateTime.ToBdsTime(); \\ It return BdsDate(weeks: 593, dayOfweek: 3)
YearDoY yearDoY = existedDateTime.ToYearDoY(); \\ It return YearDoY(year: 2017, dayOfyear: 137)

Example 2. Cast from gnssTime types. Explicit cast.

GpsDate gpsDate = new GpsDate(1949, 3);
BdsDate bdsDate = (BdsDate)gpsDate; \\ It return BdsDate(weeks: 593, dayOfweek: 3)
YearDoY yearDoY = (YearDoY)gpsDate; \\ It return YearDoY(year: 2017, dayOfyear: 137)
DateTime dateTime = (DateTime)gpsDate; \\ It return DateTime(2017, 5, 17)

Example 2. Cast from gnssTime types. Cast with extension method

using GpsTimeCalc.Extensions;
GpsDate gpsDate = new GpsDate(1949, 3);
BdsDate bdsDate = gpsDate.ToBdsDate(); \\ It return BdsDate(weeks: 593, dayOfweek: 3)
YearDoY yearDoY = gpsDate.ToYearDoY(); \\ It return YearDoY(year: 2017, dayOfyear: 137)
DateTime dateTime = gpsDate.ToDateTime(); \\ It return DateTime(2017, 5, 17)

  • .NETStandard 2.1

    • 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 History

Version Downloads Last updated
2.0.1 154 8/19/2020
2.0.0 207 2/22/2020
1.0.1 162 1/30/2020