UNIX_TIMESTAMP() function in MySQL Last Updated : 22 Dec, 2020 Comments Improve Suggest changes Like Article Like Report UNIX_TIMESTAMP() : This function in MySQL helps to return a Unix timestamp. We can define a Unix timestamp as the number of seconds that have passed since ‘1970-01-01 00:00:00’UTC. Even if you pass the current date/time or another specified date/time, the function will return a Unix timestamp based on that. Syntax : UNIX_TIMESTAMP() UNIX_TIMESTAMP(date) Parameters : It will accept only one argument. date - A date value which can be DATE, DATETIME, TIMESTAMP, or a number in 'YYYYMMDD' or 'YYMMDD' format. Return : If no parameter is passed, the function will return a Unix timestamp in seconds since '1970-01-01 00:00:00' UTC in form of an unsigned integer. But if the date parameter is passed, the function will return the value of parameter in form of an unsigned integer in seconds since '1970-01-01 00:00:00' UTC. Example-1 : Working of UNIX_TIMESTAMP() using Current date/time. SELECT UNIX_TIMESTAMP() As TimeStamp; Output : TimeStamp1606925233 Example-2 : Working of UNIX_TIMESTAMP() using date value '1999-01-22'. SELECT UNIX_TIMESTAMP('1999-01-22') As TimeStamp; Output : TimeStamp916988400 Example-3 : Working of UNIX_TIMESTAMP() using DateTime value '2020-10-17 02:35:43'. SELECT UNIX_TIMESTAMP('2020-10-17 02:35:43') As TimeStamp; Output : TimeStamp1602923743 Example-4 : Working of UNIX_TIMESTAMP() using DateTime value along with fractional seconds '2020-10-17 02:35:43.12345'. SELECT UNIX_TIMESTAMP('2020-10-17 02:35:43.12345') As TimeStamp; Output : TimeStamp1602923743.12345 Comment More infoAdvertise with us Next Article UNIX_TIMESTAMP() function in MySQL V vanshgaur14866 Follow Improve Article Tags : Technical Scripter SQL Technical Scripter 2020 DBMS-SQL mysql +1 More Similar Reads UTC_TIMESTAMP() function in MySQL UTC_TIMESTAMP() function in MySQL is used to check current Coordinated Universal Time (UTC) date and time value. It returns the current UTC date and time value in YYYY-MM-DD HH:MM:SS or YYYYMMDDHHMMSS.uuu format, depending on whether the function is used in string or numeric context. Syntax : UTC_TI 2 min read TIMESTAMPDIFF() function in MYSQL TIMESTAMPDIFF() : This function in MySQL is used to return a value after subtracting a DateTime expression from another. Syntax : TIMESTAMPDIFF(unit,expr1,expr2) Parameters : It will accept three parameters. unit â It denotes the unit for the result. It can be one of the following.MICROSECOND, SECON 2 min read UTC_TIME() function in MySQL UTC_TIME() function in MySQL is used to check current Coordinated Universal Time (UTC) time value. It returns the UTC time value in 'HH:MM:SS' or HHMMSS format, depending on whether the function is used in string or numeric context. Syntax : UTC_TIME OR UTC_TIME() Parameter : This method does not ac 2 min read CURRENT_TIMESTAMP() function in MySQL CURRENT_TIMESTAMP() function in MySQL is used to check the current date and time value. In MySQL function, CURRENT_TIMESTAMP is needed when you need to keep a record of the exact time of delivery which is helpful in improving the services and functionalities of any organization. The format of this f 2 min read TIME() Function in MySQL The TIME() function in MySQL is used to extract the time portion from a date or datetime expression, returning the time in the format 'HH:MM'. This function is particularly useful when working with time components in databases, such as scheduling or logging systems. In this article, We will learn ab 4 min read Like