
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is the range of date time value that we can pass as an argument to MySQL UNIX_TIMESTAMP function?
The range of date time value that we can pass as an argument to MySQL UNIX_TIMESTAMP function is the same as the range of TIMESTAMP data type i.e. between ‘1970-01-01 00:00:01’ to ‘2038-01-19 08:44:07’. If we give the date time values in UNIX_TIMESTAMP function beyond or below TIMESTAMP range, MySQL will return 0 as output. It can be understood with the help of the following example −
mysql> select UNIX_TIMESTAMP('2038-01-19 08:44:07'); +---------------------------------------+ | UNIX_TIMESTAMP('2038-01-19 08:44:07') | +---------------------------------------+ | 2147483647 | +---------------------------------------+ 1 row in set (0.00 sec) mysql> select UNIX_TIMESTAMP('2038-01-19 08:44:08'); +---------------------------------------+ | UNIX_TIMESTAMP('2038-01-19 08:44:08') | +---------------------------------------+ | 0 | +---------------------------------------+ 1 row in set (0.00 sec) mysql> select UNIX_TIMESTAMP('1969-01-01 05:10:00'); +---------------------------------------+ | UNIX_TIMESTAMP('1969-01-01 05:10:00') | +---------------------------------------+ | 0 | +---------------------------------------+ 1 row in set (0.00 sec)
- Related Articles
- What MySQL returns if we use UNIX_TIMESTAMP() function with no argument?
- What MySQL returns if we include time components along with date component as an argument to DATEDIFF() function?
- What MySQL returns if we include date components along with time component as an argument to TIMEDIFF() function?
- Can we pass objects as an argument in Java?
- On passing an out-of-range value in UNIX_TIMESTAMP() or FROM_UNIXTIME() function, what MySQL will return?
- What happens if we provide NULL as an argument to MySQL CHAR() function?
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- How to pass Python function as a function argument?
- In MySQL, how can we represent the time value as an integer?
- Java Program to Pass ArrayList as the function argument
- How to pass the address of structure as an argument to function in C?
- How to pass an entire structure as an argument to function in C?
- How to pass the address of structure as an argument to function in C language?
- What MySQL ELT() function returns if we the index number, provided as an argument, is less than 1?
- How to pass entire structure as an argument to function in C language?

Advertisements