Jump to content

[SOLVED] Formated date


Lambneck

Recommended Posts

Hello,

I am trying to echo form submission dates like so:

 

 date("l M dS, Y, H:i:s")

 

my question is how?

I have the following echoing rows from database table.

The submission_date is the column where, obviously, the submission dates are kept:

 

<?php
//Include database connection details

if (!mysql_connect($db_host, $db_user, $db_pwd))
    die("Can't connect to database");

if (!mysql_select_db($database))
    die("Can't select database");

$result = mysql_query("SELECT * FROM $table ORDER BY submission_id DESC");

if (!$result) {
    die("Query to show fields from table failed:".mysql_error());
}

while($row = mysql_fetch_array($result))
{
  echo "<table id=table1>";
  echo "<tr><td><b>";
  echo '<a href="resumeDisplay.php?id='.$row['submission_id'].'">'.$row['col_4'].'</a>';
  echo "</b><br />";
  echo $row['col_2'];
  echo "  |  ";
  echo $row['submission_date'];
  echo "</font></tr></td>";
  echo "</table>";
}
mysql_free_result($result);
?>

 

Link to comment
https://forums.phpfreaks.com/topic/127818-solved-formated-date/
Share on other sites

sorry, I'm not sure what you mean.

as i can tell the function time() stored the time/date of form submissions as an integer in the database column submission_date.

I just want that submission date to be echoed as an actual date,

because as it is i call the submission_date column to be displayed and it shows up as the 10 digit integer.

Link to comment
https://forums.phpfreaks.com/topic/127818-solved-formated-date/#findComment-661736
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.