Have you tried using something like CURRENT_TIMESTAMP(6)
?
This should give you the timestamp in the format you want.
You can find more information about the CURRENT_TIMESTAMP
function in this blog post or in the MYSQL DOCs.
To convert the timestamp to EST you could use the following:
CONVERT_TZ( UTC_TIMESTAMP, '+0:00', '-4:00');
Alternatively:
CONVERT_TZ( UTC_TIMESTAMP, 'UTC', 'EST');
In place of CURRENT_TIMESTAMP
. For more information about the MYSQL CONVERT_TZ
Function go here.
Here you use MYSQLs UTC timestamp to get a timestamp that is 4 hours before UTC time.
For the second methode to work you need to load a timezone table into mysql:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
You can find more information on how to load timezone tables into MYSQL on different operating systems in this answer.