Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2011
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Mysql Timestamp showing old date

    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

  • #2
    New Coder
    Join Date
    Jun 2011
    Posts
    29
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by aagarathi View Post
    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

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    First of all, find out if maybe your PHP code is doing something wrong.

    Just try doing
    Code:
    <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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •