php - DATETIME2 to UNIX timestamp
Get the solution ↓↓↓Is there a simple function to convert the the datetime2 format to output correctly using PHP?
I'm able to get a correct date, but the time always returns as 00:00:00, despite showing correctly on the database.
I'm using the following to output the date/time;
echo $row['OrderDate']->format('d/m/Y H:i:s');
I have tried various suggested solutions without any success (perhaps they only work on datetime, not datetime2?)
Not sure if this is relevant, but the field is set with a precision of 19 and length of 6 in datetime2 format.
The data appears like so in the SQL;
2020-07-13 09:00:48
Any advice would be greatly appreciated!
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: an exception occurred in the driver: could not find driver
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.