convert unknown time format to english time format dd/mm/yyyy in PHP [duplicate]

57
December 08, 2019, at 10:00 AM
This question already has answers here:
Convert timestamp to readable date/time PHP (13 answers)
Closed 8 hours ago.

Given an unknown time format like "1574550000" or "1543616635" in a db column formatted with biginit(16) I need it to convert it in PHP to english time format like dd/mm/yyyy

The function strtotime does not work. It puts out nothing.

Can anyone recognize the time format and know how to convert it?

Answer 1

This is the UNIX timestamp format. It can be converted from the format into a human-readable format via:

$epoch = 1483228800;
$dt = new DateTime("@$epoch");
echo $dt->format('dd/m/Y');

https://www.epochconverter.com/programming/php

READ ALSO
Get data from multiple array in Controller

Get data from multiple array in Controller

I have country list in array with multiple array, like:

27
Parsing JSON in PHP using json_decode

Parsing JSON in PHP using json_decode

I'm trying to get request from web service which insert my data in Json formatMy PHP code which is not succeed is shown below:

47
How to get results of more than one condition at a time

How to get results of more than one condition at a time

I even don't know how to ask my question!

57
PHP: When using javascript in a html file I could assign var mythis=this in the global scope. Is there a similiar way in PHP?

PHP: When using javascript in a html file I could assign var mythis=this in the global scope. Is there a similiar way in PHP?

When using javascript in a html file I could assign var mythis=this in the global scopeIs there a similiar way in PHP?

52