I was checking on some older code when I noticed the datetime is not appearing as a string in the console.
Here is how it looks in the console:
Here is the PHP code that displays the above picture:
data-conStatDate=".$row['STATUS_DATE_TIME']."
I tried to do the following:
data-conStatDate=".strtotime(date($row['STATUS_DATE_TIME'])."
But that only outputs the year.
This seems like such a simple task, but I cannot seem to figure out why the date is appearing in the console that way.
You're not generating the HTML attribute with quote marks, so because the output of your PHP contains a space, the browser treats the part after the space as something else (another attribute, in fact), not as part of the attribute value.
The easiest thing is just to add some single quotes round the output:
data-conStatDate='".$row['STATUS_DATE_TIME']."'
This will ensure the browser treats everything with the quote marks as being part of the attribute's value.
You'll then get output along the lines of
data-conStatDate='2018-11-16 01:20:00'
in your page.