morilog / jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in php appliations, based on Jalali (Shamsi) DateTime class.
MIT License
860 stars 110 forks source link

first day of last month #56

Closed Hesammousavi closed 3 years ago

Hesammousavi commented 5 years ago

how can i have this result ? $date = Jalalian::forge('first day of last month'); // present time for example : 1397-08-08 // output : 1397-07-01

morilog commented 5 years ago

because forge method calls Gregorian calendar first day of month then converts the datetime to jalali datetime. it's good to kill this method

Hesammousavi commented 5 years ago

i think somehow you should fix it or add this feature of course if it's possible to fix

pouyasalimi commented 4 years ago

[$lastMonth = Jalalian::forge("last month", new \DateTimeZone('UTC'))->format('Y/m/01 00:00:00');]