vendredi 9 novembre 2018

Carbon convert no of days to human readable format

I need to convert 1827 days to 5 years .If months and days are means then like 5 years 2 month 2 days I have tried below but it will return wrong result

 echo CarbonInterval::days(1827 )->cascade()->forHumans();

Result

5 years 5 months 1 week

But the above result is wrong .Correct result is 5 years

Can any one help me how i can achieve this



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire