On what date were the most events logged on devices for 40-year-old male users?
date refers to timestamp; most events refers to MAX(COUNT(event_id)); 40-year-old  refers to age = 40; male refers to gender = 'M';
SELECT T.timestamp FROM ( SELECT T2.timestamp, COUNT(T2.event_id) AS num FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'M' AND T1.age = 40 GROUP BY T2.timestamp ) AS T ORDER BY T.num DESC LIMIT 1