Skip to content
Back to skills

Persian Dates

ASecurity

Converts and calculates dates in the Persian (Jalali, Solar Hijri, Shamsi) calendar. Use whenever the user mentions a Jalali, Shamsi or Persian date, month names like فروردین or آبان, years like 1404 or ۱۴۰۵, wants to convert to or from Gregorian, add or subtract days, find the weekday, count days between dates, print a month calendar, or fix a table that mixes calendars, even if they only say "what is this date in the Iranian calendar". Verified against known Nowruz dates.

  • 12 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 10, 2026
ai-agentspythongogitdatabase

Works with

  • cli

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 10, 2026

npx -y skills add MehranQadirian/skills --skill persian-dates --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Persian Dates?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Persian Dates
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mehranqadirian-persian-dates/badge)](https://www.skillsdirectory.com/skills/mehranqadirian-persian-dates)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: persian-dates
description: Converts and calculates dates in the Persian (Jalali, Solar Hijri, Shamsi) calendar. Use whenever the user mentions a Jalali, Shamsi or Persian date, month names like فروردین or آبان, years like 1404 or ۱۴۰۵, wants to convert to or from Gregorian, add or subtract days, find the weekday, count days between dates, print a month calendar, or fix a table that mixes calendars, even if they only say "what is this date in the Iranian calendar". Verified against known Nowruz dates.
---

# persian-dates

Convert between Gregorian and Jalali dates reliably, with Persian digits accepted on input and available on output. Standard library only.

```
persian-dates/
├── SKILL.md
├── scripts/
│   └── jalali.py          today, to-jalali, to-gregorian, add, diff, month; importable functions
└── references/
    └── calendar.md        months, weekdays, leap rule, checked reference dates, data advice
```

## When to use

- Converting a date either way between the two calendars
- Adding days, finding the weekday or the distance between dates
- Showing a month calendar
- Cleaning a column that mixes Jalali and Gregorian dates
- Choosing how to store Persian dates in a database

## Workflow

1. **Identify the calendar** of every date. Years around 1300 to 1500 are Jalali, around 1900 to 2100 are Gregorian. If a value is ambiguous, ask.
2. **Convert with the script** instead of mental arithmetic:
   `python3 scripts/jalali.py to-jalali 2026-11-02 --names` gives `دوشنبه 11 آبان 1405`
   `python3 scripts/jalali.py to-gregorian ۱۴۰۵/۰۸/۱۱` gives `2026-11-02`
3. **Calculate** with `add` and `diff`:
   `python3 scripts/jalali.py add 1405-08-11 --days 30`
   `python3 scripts/jalali.py diff 1405-01-01 1405-08-11`
4. **Validate**: the script rejects impossible days such as 31 Mehr or 30 Esfand in a non-leap year (exit code 2).
5. **For bulk data**, import the functions rather than calling the CLI per row:
   ```python
   from jalali import gregorian_to_jalali, jalali_to_gregorian
   gregorian_to_jalali(2026, 11, 2)    # (1405, 8, 11)
   ```
6. **Report** both calendars side by side so the user can check.

## Rules

- Never convert by adding a fixed number to the year; the calendars shift every year
- Store ISO Gregorian dates in data and convert for display; if Jalali must be stored, zero pad and use Western digits
- Say which calendar a date is in whenever you write one
- State the limit: the 33-year rule matches the official calendar for years in everyday use; for legal deadlines near a leap boundary, advise checking an official calendar
- Remember Iran's weekend is Friday, and the week starts on Saturday
- Keep time zones separate: this skill converts dates, not timestamps (Iran is UTC+3:30, with changing daylight saving rules)

## What to report back

| Field | Content |
|-------|---------|
| Input | the date as given, with its calendar |
| Result | both calendars, weekday name |
| Method | script and rule used, plus the limitation if relevant |
| Warnings | ambiguous input, invalid days, leap year edge cases |

## Related skills

- `persian-text-processing`: normalize digits and letters before parsing
- `csv-profiling`: detect mixed date formats in a data file
- `document-conversion`: Persian reports with correct layout

Files in this skill

  • README.md1008 B
  • SKILL.md3.3 KB
  • references/calendar.md2.7 KB
  • scripts/jalali.py6.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.