logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.


Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Can PHP be achieved plus 1.5 years?
Author
spser



Joined: 29 Aug 2016
Posts: 89

PostPosted: Mon 25 Oct '21 10:50    Post subject: Can PHP be achieved plus 1.5 years? Reply with quote

$t = strtotime('+1.5 year', time());

Can PHP be achieved plus 1.5 years?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7031
Location: Germany, Next to Hamburg

PostPosted: Mon 25 Oct '21 21:03    Post subject: Reply with quote

Yes,

Code:

php -a                                                                                                                                   
Interactive shell

echo strtotime('+1.5 year', time());
1792958568
Back to top
timo



Joined: 03 Jun 2012
Posts: 42
Location: FI, EU

PostPosted: Tue 26 Oct '21 6:59    Post subject: Reply with quote

php > echo date("j.n.Y", strtotime("+1.5 year", time()));
26.10.2026
This is 5 years ahead

php > echo date("j.n.Y", strtotime("+18 month", time()));
26.4.2023
This is 1,5 years ahead

In PHP Manual
›Supported Date and Time Formats
›Relative Formats


number format is
Code:
[+-]?[0-9]+
, no decimal point included.
Back to top


Reply to topic   Topic: Can PHP be achieved plus 1.5 years? View previous topic :: View next topic
Post new topic   Forum Index -> Other Software