Skip to content
Advertisement

Add decimal years in php

I can add years to a date in PHP like

JavaScript

How can I add decimal numbers of years in PHP? I want to do something like

JavaScript

Thanks

Advertisement

Answer

Multiply it by 365, round down to the nearest integer, and add that many days, e.g.:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement