Project / Support Center
Welcome, Guest. Please login or register. November 28, 2023, 08:24: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  php related  |  Topic: adding a number of days to current date 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: adding a number of days to current date  (Read 8773 times)
admin
Administrator
******
Offline Offline

Posts: 239


« on: December 30, 2014, 11:51: PM »

<?php
   echo date('m-d-Y', mktime(date('h'),date('i'),date('s'),date('m'),date('d')+30,date('Y')))."\n";

?>

change bold for # of days added  -
Red add a new line at the end of the date - below is without the new line
Maroon is the way the date will display.
To insert into a mysql date field - display as Ymd - no spaces or dashes in between

<?php echo date('m-d-Y', mktime(date('h'),date('i'),date('s'),date('m'),date('d')+365,date('Y')));?>
« Last Edit: October 25, 2019, 04:18: PM by admin » Report to moderator   Logged

The Unknown Webmaster
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  php related  |  Topic: adding a number of days to current date « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!