{"id":13817754,"url":"https://github.com/mfathi91/persian-date-time","last_synced_at":"2025-05-15T20:32:46.520Z","repository":{"id":159772955,"uuid":"105186275","full_name":"mfathi91/persian-date-time","owner":"mfathi91","description":"Persian Date Time","archived":false,"fork":false,"pushed_at":"2022-01-12T22:39:41.000Z","size":144,"stargazers_count":80,"open_issues_count":1,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-19T15:45:31.124Z","etag":null,"topics":["calendar","gregorian","immutable","iranian-calendar","jalali-calendar","java","persian-calendar","persian-datetime","persiandate"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mfathi91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-09-28T18:42:01.000Z","updated_at":"2024-10-30T21:54:00.000Z","dependencies_parsed_at":"2024-01-13T15:37:46.426Z","dependency_job_id":"a7d7afb3-6401-490f-ac16-74c495f3460b","html_url":"https://github.com/mfathi91/persian-date-time","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfathi91%2Fpersian-date-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfathi91%2Fpersian-date-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfathi91%2Fpersian-date-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfathi91%2Fpersian-date-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfathi91","download_url":"https://codeload.github.com/mfathi91/persian-date-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254418743,"owners_count":22068143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","gregorian","immutable","iranian-calendar","jalali-calendar","java","persian-calendar","persian-datetime","persiandate"],"created_at":"2024-08-04T06:00:54.772Z","updated_at":"2025-05-15T20:32:43.763Z","avatar_url":"https://github.com/mfathi91.png","language":"Java","funding_links":[],"categories":["جاوا Java"],"sub_categories":[],"readme":"![Persian Date Time](https://user-images.githubusercontent.com/29010410/41397561-dc9a470a-6fc9-11e8-923a-112393900b0c.JPG)\n----------------------------------------------------\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.mfathi91/persian-date-time/badge.svg)](http://search.maven.org/#search|ga|1|com.github.mfathi91)\n[![codecov](https://codecov.io/gh/mfathi91/persian-date-time/branch/master/graph/badge.svg)](https://codecov.io/gh/mfathi91/persian-date-time)\n[![Javadocs](http://javadoc.io/badge/com.github.mfathi91/persian-date-time.svg?color=brightgreen)](http://javadoc.io/doc/com.github.mfathi91/persian-date-time)\n\n\n\nThis library is an implementation of [Solar Hijri calendar](https://en.wikipedia.org/wiki/Solar_Hijri_calendar) (also known as Jalali calendar or Persian calendar). It is an immutable and thread-safe implementation of Persian calendar system, and can be used in multi-threaded programs.\n\nAs Java does not support Persian calendar, this library can be used in the applications that need Persian calendar system. Purpose of this library is to provide an immutable and easy API (that is similar to JDK 8 date and time API) for Persian calendar system. This class has been implemented the same as internal JDK calendars such as JapaneseDate.\n\n## Instructions\n\n### Maven\nInclude the following to your dependency list:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.mfathi91\u003c/groupId\u003e\n  \u003cartifactId\u003epersian-date-time\u003c/artifactId\u003e\n  \u003cversion\u003e4.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Usage\n`PersianDate`: The base class for Persian date handling. Here are some trivial examples on how to use different \nfunctionalities of `PersianDate`\n```java\n// Instantiate \nPersianDate today = PersianDate.now();\nPersianDate persianDate1 = PersianDate.of(1396, 7, 15);\nPersianDate persianDate2 = PersianDate.of(1396, PersianMonth.MEHR, 15);\n\n// Convert\nPersianDate persianDate5 = PersianDate.of(1397, 5, 11);\nLocalDate gregDate = persianDate.toGregorian();    // =\u003e '2018-08-02'\nPersianDate persianDate6 = PersianDate.fromGregorian(gregDate);  //  =\u003e '1397/05/11'\n\n// Parse\nPersianDate persianDate3 = PersianDate.parse(\"1400-06-15\");    // From the standard format\nPersianDate persianDate4 = PersianDate.parse(\"1400/06/15\", DateTimeFormatter.ofPattern(\"yyyy/MM/dd\"));    // From a desired format\n\n// Format\nDateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"yyyy/MM/dd\");\ndtf.format(PersianDate.now());    // =\u003e e.g. '1396/05/10'\n```\n`PersianDateTime`: A wrapper class around `PersianDate` and `LocalTime` to make the date-time handling more \nconvenient. Here are some trivial examples of `PersianDateTime`\n```java\n// Instantiate\nPersianDateTime now = PersianDateTime.now();    // =\u003e 'now' will contain the instantiated date and time\nPersianDateTime persianDateTime2 = PersianDateTime.of(PersianDate.of(1400, PersianMonth.DEY, 15), LocalTime.of(17, 55, 19));\nPersianDateTime persianDateTime3 = PersianDateTime.of(1400, PersianMonth.DEY, 15, 17, 55, 19);\n\n// Parse\nPersianDateTime persianDateTime4 = PersianDateTime.parse(\"1401-06-10T08:35:11\");    // From the standard format\nPersianDateTime persianDateTime5 = PersianDateTime.parse(\"1400-06-15_11-38-43\", DateTimeFormatter.ofPattern(\"yyyy-MM-dd_HH-mm-ss\"));    // From a desired format\n\n// Format\nDateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"yyyy/MM/dd HH:mm:ss\");\ndtf.format(PersianDateTime.now());    // =\u003e e.g. '1396/05/10 14:05:11'\n```\nThe conversion algorithm from Solar Hijri calendar to Gregorian calendar and vice versa, is adopted from [here](https://github.com/soroush/libcalendars).\n### Requirements\nThis version of Persian Date Time requires:\n * Java SE 8\n\n## License\nThis library is released under MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfathi91%2Fpersian-date-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfathi91%2Fpersian-date-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfathi91%2Fpersian-date-time/lists"}