Saturday 10 March 2018

How can I convert a DateTime in a mysql database (2018-03-25 23:59:59) to a 'days remaining' variable in node.js?

Hi, I'm making a discord bot and need to somehow convert that date into a simple days remaining integer and store it into a variable in node.js. How would I convert it to an integer?As of now I have a query which converts it to unix timestamp stores the result in a variable. When I console.log the result it comes up as:[ RowDataPacket { 'UNIX_TIMESTAMP(myTable.expires_at)': 1523429999 } ]

Submitted March 10, 2018 at 08:43AM by Brinstakilla

No comments:

Post a Comment