Jump to content

[SOLVED] MySQL TimeStamp


BillyBoB

Recommended Posts

This worked before my host got switched idk if its me or not but i have my file as timestamp(14)
http://dreamshowstudios.net
the news on there ^^ is where

heres coding:

[code]
<?php
$datefromdb = $row['whenposted'];
$year = substr($datefromdb,0,4);
$mon  = substr($datefromdb,4,2);
$day  = substr($datefromdb,6,2);
$hour = substr($datefromdb,8,2);
$hour = $hour - 6;
$min  = substr($datefromdb,10,2);
$sec  = substr($datefromdb,12,2);
$time = date("l F dS, Y h:i A",mktime($hour,$min,$sec,$mon,$day,$year));

echo '<center>' . $row['title'] . '<br />by ' . $row['poster'] . ' on ' . $time . ' CST<br />';
echo $row['textmessage'] . '<br /><hr /></center>';
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/30957-solved-mysql-timestamp/
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.