Welcome Guest, Not a member yet? Register   Sign In
Timestamp Troubles
#1

[eluser]Konvurt[/eluser]
I have a snippet of code where I want to show the date and time for every time a client uses a discount card. Clients can not have more than two entries per card. However, when I try to display the two entries with the appropriate formatting only the older timestamp formats properly. Code below:
Code:
Last Used:
<?php

$timestamp = mysql_to_unix($row->trans_date);  //MySql Time stamp 2011-05-31 12:49:59
date_default_timezone_set('America/Chicago');  //Push timestamp ahead 2 hours
$lastuse = date('F j, Y @ g:i A', $timestamp); //format date
    
    echo $lastuse;
    

?>
<?php endforeach; ?>

I have two timestamps coming in 1306871399 and 1306864204. The first stamp successfully processes as May 31, 2011 @ 2:49 PM, but the second comes out May 31, 2011 @ 12:50 PM.

I am not understanding why only one of the timestamps are being processed. Your feedback is appreciated.
#2

[eluser]TWP Marketing[/eluser]
Try echoing the value of $timestamp before and after you change timezones.




Theme © iAndrew 2016 - Forum software by © MyBB