
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
A Jalali to Gregorian and Gregorian to Jalali converter with no dependency!
DateThis plugin convert jalali to gregorian and gregorian to jalali in the most simple way
Convert gregorian to jalali
shamsi.gregorianToJalali(1989, 1, 24); //[1367, 11, 4]
Convert jalali to gregorian
shamsi.jalaliToGregorian(1367, 11, 4); //[1989, 1, 24]
Install via npm
npm install shamsi -S
Install via yarn
yarn add shamsi
Install it via npm or yarn then use it as the following code
var shamsi = require("shamsi");
shamsi.gregorianToJalali(1989, 1, 24);
get library using bower, npm, cdn, or cloning the repository
<script src="https://unpkg.com/shamsi"></script>
<script>
shamsi.gregorianToJalali(1989, 1, 24);
</script>
import * as shamsi from 'shamsi';
...
render() {
return (<p>{shamsi.gregorianToJalali(1989, 1, 24).join('/')}</p>);
}
get library using bower, npm, cdn, or cloning the repository
<script src="https://unpkg.com/shamsi"></script>
<script>
$("#date").text(shamsi.gregorianToJalali(1989, 1, 24).join('/'));
</script>
DateIf you want to pass date as input like:
var date1 = new Date("December 17, 1995 03:24:00");
// OR
var date2 = new Date("1995-12-17T03:24:00");
// OR sth else
gregorianToJalali(date1);
you have to use shamsi-date-converter
If you want to pass formatted date as input or get formatted date from output like:
gregorianToJalali("1995/7/17"); // => 1374/4/26
// OR
jalaliToGregorian("1374/4/26"); // => 1995/7/17
// OR other formats as input or outputs
you have to use shamsi-formatter
FAQs
A Jalali to Gregorian and Gregorian to Jalali converter with no dependency
The npm package shamsi receives a total of 468 weekly downloads. As such, shamsi popularity was classified as not popular.
We found that shamsi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.