sorry, but time formats should not play a role here.!
He is not converting any date/datetime/timestamp to strings. Column is datetime, and he is providing a datetime variavle type!
Regardless what is the end-user datetime format (24h or 12h) the correct hour should be saved at the database.