Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
set dateime value in input from using php

In the code below I tried to display datetime value from DB in input which it's type is datetime. The problem is that I dont know what is the correct format to do so.

<input class="form-control" name="date_to_discuss" id="date_to_discuss" type="datetime-local"
value="<?php echo date_format($proposal["Date_To_Disscus"], 'Y-m-dTH:i:s');?>" />

I tried to look for answers in the internet but it was useless..

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try this:

<?php
$proposal["Date_To_Disscus"] = '2017-04-12';
?>
<input class="form-control" name="date_to_discuss" id="date_to_discuss" type="datetime-local"
value="<?php echo strftime('%Y-%m-%dT%H:%M:%S', strtotime($proposal["Date_To_Disscus"]));?>" />

OUTPUT:

2017-04-12T00:00:00

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!