Jump to content

[SOLVED] record creation date


alohatofu

Recommended Posts

When pulling the data back it will display in unix time format ie 1176857705

 

 

so use this

<?php
$timestamp = row['FieldName']; // <-- pull as normal 
echo date("m/d/y",$timestamp)
?>

 

Oh better point this out

 

Barand

Senile

Super Moderator

Genius

**********

The problem with TIMESTAMP columns is that they will update automatically so if, a few months down the line, you change the value of, say, the name field because of a misspelling, the timestamp field becomes the date of the change and not the original date registered.

 

 

Barand recommand you don't use the 'DEFAULT CURRENT_TIMESTAMP' but instead the following

When you add a record put the MySQL value NOW() into that column.

 

personally i havn't had any problems but he highly likly better than me (at PHP & MySQL atleast)

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.