Download the PHP package ariaieboy/jalali without Composer
On this page you can find all versions of the php package ariaieboy/jalali. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ariaieboy/jalali
More information about ariaieboy/jalali
Files in ariaieboy/jalali
Package jalali
Short Description This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in php appliations, based on Jalali (Shamsi) DateTime class.
License MIT
Homepage https://github.com/ariaieboy/jalali
Informations about the package jalali
Ariaieboy/jalai
-
Jalali calendar is a solar calendar that was used in Persia, variants of which today are still in use in Iran as well as Afghanistan. Read more on Wikipedia or see Calendar Converter.
-
Calendar conversion is based on the algorithm provided by Kazimierz M. Borkowski and has a very good performance.
- This repo is a hard fork from morilog/jalali
Difference with morilog/jalali
- Automated testing
- Level 9 PHPStan check
- Carbon 3 support
- Only dependant on Carbon
Installation
You can install the package via composer:
Basic Usage
You can use Jalali
class for manipulating Jalali date time
Jalali
You can use jdate()
helper instead of Jalali::forge()
;
now([$timestamp = null])
Methods api
CalendarUtils
checkDate($year, $month, $day, [$isJalali = true])
toJalali($gYear, $gMonth, $gDay)
toGregorian($jYear, $jMonth, $jDay)
strftime($format, [$timestamp = false, $timezone = null])
createDateTimeFromFormat($format, $jalaiTimeString)
createCarbonFromFormat($format, $jalaiTimeString)
convertNumbers($string)
Carbon api-difference
You can convert date/time to briannesbitt/carbon, thus being able to use it's API to work with PHP DateTime class.
Difference in months:
Formatting
For help in building your formats, checkout the PHP strftime() docs.
Notes
The class relies on strtotime()
to make sense of your strings, and strftime()
to handle the formatting. Always check the time()
output to see if you get false timestamps, it which case, means the class couldn't understand what you were asking it to do.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- AriaieBOY
- All Contributors
License
The MIT License (MIT). Please see License File for more information.