Reputation: 26728
Hi I worked on Mssql recently and somewhere i got following query
query = "select dateadd(SS,1,getdate()) as 'StartTime'"
Here i can expect getdate()
in Mssql is now()
in Mysql
But i want to do the functionality of the above MSSQL query in MYSQL , so can anyone please let me know how to write the same query in MYSQL
Upvotes: 0
Views: 107
Reputation: 32602
query = "SELECT DATE_ADD(now(), INTERVAL 1 SECOND) as StartTime"
Reference MySQL: DATE_ADD
Upvotes: 1
Reputation: 263803
Try this,
query = "SELECT DATE_ADD(NOW, INTERVAL 1 SECOND) `Start_Time`"
Upvotes: 0
Reputation: 11240
You can use this:
SELECT DATE_ADD(NOW(), INTERVAL 1 SECOND) AS starttime
Upvotes: 0
Reputation: 33474
DATE_ADD(now(), 1, 'SECONDS')
Based on documentation here
OR
now() + INTERVAL 1 SECOND
Upvotes: 2