Logo Lanfrica

andegna/calender

Type de record:

software
Créateur:
and
Hôte:
If you ever want to convert Ethiopian Calender to any other calender system (like the Gregorian Calender) this is the right package for you. And by the way it also support Amharic date formatting and much much more. # Andegna Calender > If you ever want to convert **Ethiopian Calender** to any other calendar system > (like the Gregorian Calendar) this is the right (well-tested, well designed, high quality) package for you. > > And by the way it also supports Amharic date formatting and much much more. - Basic Usage - Requirement - Installation - Conversion - From Ethiopian Date - From Timestamp - From DateTime object - From date string - From the system time - To DateTime - Low level Conversion - How PHP calendar conversion works - From JDN - To JDN - Practical Example - Manipulation - Warning - Manipulating the internal date time - Formatting - Introduction - Additional character formats - Constants - Holidays - Easter - Validators - Contributing ## Basic Usage :hammer: ↑ Just to give you the 10,000-foot view (:airplane:) of the package. ```php // create a gregorian date using PHP's built-in DateTime class $gregorian = new DateTime('next monday'); // just pass it to Andegna\DateTime constractor and you will get $ethiopian date $ethipic = new Andegna\DateTime($gregorian); ``` Format it ```php // format it // ሰኞ፣ ግንቦት ፯ ቀን (ሥላሴ) 00:00:00 እኩለ፡ሌሊት EAT ፳፻፱ (ማርቆስ) ዓ/ም echo $ethipic->format(Andegna\Constants::DATE_GEEZ_ORTHODOX); // ሰኞ፣ ግንቦት 07 ቀን 00:00:00 እኩለ፡ሌሊት EAT 2009 ዓ/ም echo $ethipic->format(Andegna\Constants::DATE_ETHIOPIAN); ``` Modify it ```php $ethipic->modify('+8 hours'); $ethipic->sub(new DateInterval('PT30M')); // 30 minutes // ሰኞ, 07-ግን-2009 07:30:00 EAT echo $ethipic->format(DATE_COOKIE); ``` Get what you want :wink: ```php echo $ethipic->getYear(); // 2009 echo $ethipic->getMonth(); // 9 echo $ethipic->getDay(); // 7 echo $ethipic->getTimestamp(); // 1494822600 // turn it back to gregorian // Monday, 15-May-2017 07:30:00 EAT echo $ethipic->toGregorian()->format(DATE_COOKIE); ``` ## Requirement ↑ Andegna Calender requires `php: >=7.0` with fire and blood :fire: :dragon:. Please notice the name of this package is `ande …