MariaDB 10.2.7 doesn't accept trailing Z for DATETIME timezone when inserting, but earlier version does
MariaDB does not recognize your date format. In previous versions it autocorrefted value for you, but starting from version 10.2.4 MariaDB changed SQL mode to stricter and raises error instead of warning for faulty SQL queries.
If it's production, then temporary solution would be changing sql_mode to be not so strict. Change file /etc/my.cnf (on CentOS)

[mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER


And restart mariadb service. I suggest you changing your query for MariaDB to fully understand it.
More info on sql_mode here: https://mariadb.com/kb/en/mariadb/sql-mode/