GETDATE Function - SQL Server to MariaDB Migration

In SQL Server the GETDATE function returns the current date and time with milliseconds precision without the time zone for the current database instance.

In MariaDB you can use the NOW(3) function.

SQL Server:

  -- Get the current date and time with milliseconds precision
  SELECT GETDATE();
  # 2024-07-28 13:13:11.640

MariaDB:

  -- Get the current date and time with milliseconds precision
  SELECT NOW(3);
  # 2024-07-28 13:13:11.640

For more information, see SQL Server to MariaDB Migration.