From what you say, you're trying to insert a string with a certain format in the DATA
column that seems to be some kind of datetime
, in which case, the problem you have is that you should "interpret" the string in a datetime
before inserting the value. We can use STR_TO_DATE()
:
INSERT INTO access_wifi(DATA) VALUES (STR_TO_DATE('0511201813450367', '%d%m%Y%H%i%s%f'))
Then, the other problem is to see the full date, for which you can make use of DATE_FORMAT()
:
select DATE_FORMAT(DATA, '%Y-%m-%d %H:%i:%s:%f')
FROM access_wifi
you can consult the complete documentation of the format string in the links to the functions, in your case we are using
╔════╦════════════════════════════════════╗
║ %d ║ Day of the month, numeric (00..31) ║
╠════╬════════════════════════════════════╣
║ %f ║ Microseconds (000000..999999) ║
╠════╬════════════════════════════════════╣
║ %H ║ Hour (00..23) ║
╠════╬════════════════════════════════════╣
║ %i ║ Minutes, numeric (00..59) ║
╠════╬════════════════════════════════════╣
║ %m ║ Month, numeric (00..12) ║
╠════╬════════════════════════════════════╣
║ %Y ║ Year, numeric, four digits ║
╠════╬════════════════════════════════════╣
║ %s ║ Seconds (00..59) ║
╚════╩════════════════════════════════════╝
Note: The column should be a datetime
(eg datetimr(3)
) with enough precision to accommodate the milliseconds that you want to insert