0

My timestamp in MySQL is 1571591400 and I want to get the date from this timestamp. I have tried a number of things but but nothing has worked.

"SELECT * FROM fixture_fixture WHERE from_unixtime(event_timestamp, '%Y-%m-%d') = '$date'";
Dharman
  • 30,962
  • 25
  • 85
  • 135
shah
  • 11
  • 4
  • Already answered https://stackoverflow.com/questions/6267564/convert-unix-timestamp-into-human-readable-date-using-mysql – Jahan zeb Dec 04 '19 at 09:49
  • Does this answer your question? [Convert Unix timestamp into human readable date using MySQL](https://stackoverflow.com/questions/6267564/convert-unix-timestamp-into-human-readable-date-using-mysql) – Dharman Dec 04 '19 at 10:16

2 Answers2

1

Below may help.

SELECT FROM_UNIXTIME(1571591400, '%D %M %Y');
o/p - '20th October 2019'
SELECT FROM_UNIXTIME(1571591400) As 'String';
o/p - '2019-10-20 21:10:00'
lczapski
  • 4,026
  • 3
  • 16
  • 32
0

If you want date from you timestamp then you should trythis

  SELECT DATE_FORMAT(FROM_UNIXTIME(column_name), '%e %b %Y') AS 'date_formatted' FROM `fixture_fixture `
Vikas Verma
  • 149
  • 1
  • 11