PHP date; How to find the next year?

前端 未结 8 1680
生来不讨喜
生来不讨喜 2021-01-07 18:27

I want to get today\'s date + one year. How do I achieve this with PHP\'s date functions?

8条回答
  •  囚心锁ツ
    2021-01-07 18:48

    You could use the new Datetime and Datetime_Intervall-classes introduced in the later PHP 5-versions.

    I once posted an answer in this question. Maybe it helps you :)

    The advantage is, that this classes also checks for leap-seconds and leap-years, timezones, etc.

提交回复
热议问题