how to get datetime in mysql code example Example 1: query current time CURRENT_TIMESTAMP Example 2: mysql get date from datetime WHERE DATE(datetime) = '2009-10-20'