function MySQLTimeStampCompatibleString(timestamp){ return new Date(timestamp).toISOString().substring(0, 19).replace('T', ' '); } function queryWithTimestampLongValues(fromTime, toTime) { var query = ""; if(fromTime && toTime){ query += 'SELECT * FROM user_info WHERE user_info.created_at > TIMESTAMP("' + MySQLTimeStampCompatibleString(fromTime) + '") AND user_info.created_at < TIMESTAMP("' + MySQLTimeStampCompatibleString(toTime) + '")'; } return query; }
Read next

Angular InputMask
PrimeTek -

Create react subcomponents in a simple way!
Yogini Bende -

The Importance of Having a Personal Website
darrendube -

Getting Started with Vite 2
Alvaro Saburido -
Discussion (0)