0

I need to change the date format to 2018-09-23 but now it shows date as 1818-09-23.

<input  name="start" id="datepicker1" type="text" value="<?php echo(set_value('start') ? set_value('start') : date('yy-m-d')); ?>"  class="form-control">

Is there any possible way to get the date format as 2018-09-23 etc.

1 Answer 1

1

Try the following

<input  name="start" id="datepicker1" type="text" value="<?php echo(set_value('start') ? set_value('start') : date('Y-m-d')); ?>"  class="form-control">

Or in a more logical format:

<input  name="start" id="datepicker1" type="text" value="<?php echo(set_value('start') ? set_value('start') : date('m-d-Y')); ?>"  class="form-control">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.