SQL – MySQL TIME() Function
The MySQL TIME() function extracts the time part from a given time/datetime, and returns “00:00:00” if not a datetime/time, or NULL if expression is NULL.
The MySQL TIME() function extracts the time part from a given time/datetime, and returns “00:00:00” if not a datetime/time, or NULL if expression is NULL.
The MySQL TIME_FORMAT() function formats a time by a specified format.
The MySQL TIME_TO_SEC() function converts a time value into seconds.
The MySQL TIMEDIFF() function returns the difference between two time/datetime expressions (written in the same format).
The MySQL TIMESTAMP() function returns a datetime value based on a date or datetime value.
The MySQL TO_DAYS() function returns the number of days between a date and year 0 (date “0000-00-00”).
The MySQL WEEK() function returns the week number for a given date (a number from 0 to 53).
The MySQL WEEKDAY() function returns the weekday number for a given date.
The MySQL WEEKOFYEAR() function returns the week number for a given date (a number from 1 to 53).
The MySQL YEAR() function returns the year part for a given date (a number from 1000 to 9999).
The MySQL YEARWEEK() function returns the year and week number (a number from 0 to 53) for a given date.
The SQL Server CURRENT_TIMESTAMP() function returns the current date and time as “YYYY-MM-DD HH-MM-SS”.
The SQL Server DATEADD() function adds a time/date interval to a date and then returns the date.
The SQL Server DATEDIFF() function returns the difference between two dates.
The SQL Server DATEFROMPARTS() function returns a date from the specified parts (year, month, and day values).
The SQL Server DATENAME() function returns a specified part of a date as a string value.
The SQL Server DATEPART() function returns a specified part of a date as an integer value.
The SQL Server DAY() function returns the day of the month (from 1 to 31) for a specified date.
The SQL Server GETDATE() function returns the current database system date and time, in a “YYYY-MM-DD hh:mm:ss.mmm” format.
The SQL Server GETUTCDATE() function returns the current database system UTC date and time, in a “YYYY-MM-DD hh:mm:ss.mmm” format.