Home » mysql » Date and Time

Date and Time

There are various pre defined function for data and time we will see them one by one.

If you want to show current time then we use CURTIME().It returns time in HH:MM:SS string format

below is HHMMSS in numeric format

To select current data we use CURDATE().It returns data in YYYY-MM-DD string format.

to convert string in to number we use following query

To select current data and time we use NOW() whch returns data and time in ‘YYYY:MM:DD HH:MM:SS’ in string format or YYYYMMDDHHMMSS is numeric format.

Please follow and like us:
error