Comments - DATETIME

1 year, 8 months ago just someone

https://mariadb.com/kb/en/datetime/#examples

Strings used in datetime context are automatically converted to datetime(6). If you want to have a datetime without seconds, you should use CONVERT(..,datetime).

the datetime(number) is about the microsecond precision so in both cases it display the second but without the precesion it use the default which is 0 that why it will not display the microsecond here

SELECT CONVERT('2007-11-30 10:30:19.55',datetime);

but will show up here SELECT CONVERT('2007-11-30 10:30:19.55',datetime(6));

hope that help and have a nice day :)

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.