ConvertGregorianDateToSolar 1.0.0
dotnet add package ConvertGregorianDateToSolar --version 1.0.0
NuGet\Install-Package ConvertGregorianDateToSolar -Version 1.0.0
<PackageReference Include="ConvertGregorianDateToSolar" Version="1.0.0" />
<PackageVersion Include="ConvertGregorianDateToSolar" Version="1.0.0" />
<PackageReference Include="ConvertGregorianDateToSolar" />
paket add ConvertGregorianDateToSolar --version 1.0.0
#r "nuget: ConvertGregorianDateToSolar, 1.0.0"
#addin nuget:?package=ConvertGregorianDateToSolar&version=1.0.0
#tool nuget:?package=ConvertGregorianDateToSolar&version=1.0.0
ConvertGregorianDateToSolar
A minimal .NET library that converts Gregorian dates to Persian (Shamsi) format using PersianCalendar
.
Perfect for applications targeting Iranian users.
✨ Features
- 🔁 Converts a
DateTime
value to the Shamsi (Persian) calendar. - 📅 Uses
System.Globalization.PersianCalendar
internally. - 💼 Useful for desktop or web applications needing localized date formats.
🚀 How to Use
Install via .NET CLI:
dotnet add package ConvertGregorianDateToSolar
Or via Package Manager:
Install-Package ConvertGregorianDateToSolar
💡 Example
using System;
using ConvertGregorianDateToSolar;
class Program
{
static void Main(string[] args)
{
var converter = new ConvertDate();
var today = DateTime.Now;
string shamsi = converter.ToShamsiDate(today);
Console.WriteLine($"Shamsi Date: {shamsi}");
}
}
✔️ Sample Output:
Shamsi Date: 1404/1/20
⚙️ Method
public string ToShamsiDate(DateTime date)
Description: Converts the given DateTime to a string in yyyy/MM/dd format based on the Persian calendar.
🛠 Target Framework
.NET 9
📦 NuGet Package
You can get the package from NuGet: https://www.nuget.org/packages/ConvertGregorianDateToSolar/
📄 License
This project is licensed under the MIT License — free for personal and commercial use. See the LICENSE file for more information.
👨💻 Author
Created with ❤️ by Hamed Heydarian GitHub: https://github.com/hheydarian
🚧 This project is under active development and will be expanded with more features like:
"Shamsi to Gregorian conversion" "Localized formatting options" "Extended date formatting patterns"
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
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 | 140 | 21 days ago |