Comments - Converting unix timestamp stored as bigint to readable date time

8 years, 6 months ago Thanmaya Bekkalale

Thank you for the revert.

Here is my query:

select company_type,modified_time from companies;

and it returns

+--------------+---------------+
| company_type | modified_time |
+--------------+---------------+
| MANUFACTURER | 1444274942372 |
+--------------+---------------+

modified_time is a bigint(20) datatype.

The same query when I use:

select company_type,from_unixtime(modified_time) from companies;

for the same column it returns a NULL

+--------------+------------------------------+
| company_type | from_unixtime(modified_time) |
+--------------+------------------------------+
| MANUFACTURER | NULL                         |
+--------------+------------------------------+

other info: Server version: 5.5.44-MariaDB MariaDB Server

thank you in advance for the help!

 
8 years, 6 months ago Ian Gilfillan

Assuming you meant to store a timestamp equivalent to 04/02/47737, this is due to the Unix timestamp limit. See https://en.wikipedia.org/wiki/Year_2038_problem

Currently this is not scheduled to be fixed in MariaDB - see https://mariadb.atlassian.net/browse/MDEV-341

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.