-1

I have two inputs for pick up date and return date.I want to add today's date to be default value for pick up date and in case user changes the date, the value for return date should change to one day ahead to pick up date.any help will be appreciated. i already used time(), it gives me warning metioned in comments belows.

<input type="date" name="pickupdate" class="form-control user-success" id="pickupdate" placeholder="MM/DD/YY"> <input type="date" name="returndate" class="form-control user-success" id="RETURNDATE" placeholder="MM/DD/YY">

Asif Ali
  • 19
  • 1
  • 10
  • possible duplicate of [HTML5 Input Type Date -- Default Value to Today?](http://stackoverflow.com/questions/6982692/html5-input-type-date-default-value-to-today) – Ben Aug 11 '15 at 09:01
  • this is not exact duplicate but i dont found my answer there for return date .and setting time zone .kindly remove the duplicate and let me get answered – Asif Ali Aug 11 '15 at 09:33

1 Answers1

0

Try this..

use

Add time zone top of the php page

 date_default_timezone_set('America/New_York');

Current date:<?php echo date("Y/m/d")?>

Tomorrow :<?php echo date("Y/m/d", time()+86400)?>

   <input type="text" name="pickupdate" class="form-control user-success" id="pickupdate" placeholder="MM/DD/YY" value="<?php echo date("Y/m/d")?>">

<input type="text" name="returndate" class="form-control user-success" id="RETURNDATE" value="<?php echo date("Y/m/d", time()+86400)?>">
Deenadhayalan Manoharan
  • 5,436
  • 14
  • 30
  • 50