FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

TIMESTAMP display format help

 


sathiyasri
Hello everybody,

I dont know where and how to change the TIMESTAMP format to display in PHP. Below you will find the feild name $stamp that represents the TIMESTAMP in MySQL.

I have searched for some basic help on this but it was to advanced for me. Can someone help with this? Does the code go into the PHP or the HTML body?

Thanks!
hexkid
I'd do it on the PHP side
Code:
<?php
$format = 'Y-m-d H:i:s';
$sql = "select ... UNIX_TIMESTAMP(column) as whatever ...";
// query
// fetch into $row
echo date($format, $row['whatever']);
?>
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.