# Display Unix Timestamp from MySQL as Standard Date

**URL:** <https://forum.kirupa.com/t/display-unix-timestamp-from-mysql-as-standard-date/326610>\
**Category:** programming\
**Created:** [December 29, 2011, 8:34pm UTC](https://forum.kirupa.com/t/display-unix-timestamp-from-mysql-as-standard-date/326610 "2011-12-29T20:34:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SwanSongAtWork](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@SwanSongAtWork](https://forum.kirupa.com/u/SwanSongAtWork)\
**Post date:** [December 29, 2011, 8:34pm UTC](https://forum.kirupa.com/t/display-unix-timestamp-from-mysql-as-standard-date/326610/1 "2011-12-29T20:34:17Z")

</div>

Simple title to this post right? I’ve searched this now for days but I have come up with results that are just not what I need.

Here are the details:

I have on page one (lets say) a place where people can select a date range of records from a database they want to view. Upon hitting ok it sends them to a ‘results’ page to view this range.

On this ‘results’ page it has standard php script to display the queried results like so:

```php

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['entry_date'] . "</td>"; 
  echo "</tr>";
  }
echo "</table>";

```

- by the way, the script above i stripped out all the other table data cells that aren’t important…the one displayed is the one i’m trying to figure out how to get to display a standard time stamp.

As seen above, the entry date is displaying as a unix timestamp which is how it’s stored in the database. For example: 1304323005

What would be the syntax to add a conversion in this script to convert the entry date value to display a standard date rather than that unix timestamp?

I’ve tried strtotime() which I used other places in the script like here:

```php

$fromUnix = strtotime($_POST['from']); 

```

but I’ve tried to include this in the table code and it doesn’t seem to work properly.

Any Thoughts?

Thank you!
