N
N
NewbieL2018-02-23 23:11:17
PHP
NewbieL, 2018-02-23 23:11:17

How to write the date and time in the right format?

There is such a field <input type="datetime-local" name="data_event">
Through the form, I get its entered value like 23-02-2018 23:11:00
It is also recorded in the database, but how can I remove the last two zeros?
in the table, the data_event field has the datetime type. I need to get a date like this 23-02-2018 23:11

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kisaa, 2018-02-24
@kisaa

In the database, it will still be stored with seconds. Just don't show them when you retrieve from the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question