...

View Full Version : Mysql Timestamp showing old date



aagarathi
07-30-2011, 06:34 PM
This is my coding

<div id="ordercreated"><strong>Order Created:</strong> <?php echo date('F j, Y g:ia', $orderdata['timestamp']); ?></div>
<div id="orderupdated"><strong>Order Last Updated:</strong> <?php echo date('F j, Y g:ia', $orderdata['updated']); ?></div>

But the date it showing

Order Created: December 31, 1969 6:33pm
Order Last Updated: December 31, 1969 6:00pm


Please help me on this

aagarathi
07-30-2011, 07:08 PM
This is my coding

<div id="ordercreated"><strong>Order Created:</strong> <?php echo date('F j, Y g:ia', $orderdata['timestamp']); ?></div>
<div id="orderupdated"><strong>Order Last Updated:</strong> <?php echo date('F j, Y g:ia', $orderdata['updated']); ?></div>

But the date it showing

Order Created: December 31, 1969 6:33pm
Order Last Updated: December 31, 1969 6:00pm


Please help me on this



My timestamp in mysql store as 2011-07-07 22:30:59

Old Pedant
07-31-2011, 12:16 AM
First of all, find out if maybe your PHP code is doing something wrong.

Just try doing


<div id="ordercreated"><strong>Order Created:</strong> <?php echo $orderdata['timestamp']; ?></div>
<div id="orderupdated"><strong>Order Last Updated:</strong> <?php echo $orderdata['updated']; ?></div>

See what values are coming back from the query, first.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum