Rushi Khalkar Rushi Khalkar - 1 month ago 5x
MySQL Question

How to change format of date dd/mm/yyyy to day, month, year?

I am developing a project in that user entered a date and time from app as dd/mm/yyyy and hh:mm respectively, it stored in database in the form of dd/mm/yyyy and hh:mm....but my sms provider has api like this.....(&day=08&month=09&year=2016&hour=00&minute=01)
so how can i split this day,month,year,hour,minute as per sms provider api?


this is what you get if you run in mysql

SELECT CONCAT('&day=',DATE_FORMAT(NOW(),'%d'),'&month=',DATE_FORMAT(NOW(),'%m'),'&year=',DATE_FORMAT(NOW(),'%Y'),'&hour=',DATE_FORMAT(NOW(),'%H'),'&minute=',DATE_FORMAT(NOW(),'%i'))

output of the above query returns


Replace NOW() with your datetime values