Hello All.
I have had the following code tucked in a file for months now, waiting to use it.
I finally find a need to use it, and I can't get it to work like I need.
First, the code that DOES work:
$HourOffSet = "3";
$TimeMethod = "Y-m-d g:i A";
$TimeReadjust = ($HourOffSet 60 60);
$MyTimeZoned = date($TimeMethod,time() + $TimeReadjust);
echo $MyTimeZoned;
In essance, it takes the present time and adds three hours to it ($HourOffSet)
Now, I am needing to take an existing date, from within a MySQL database, and have it change the date within the db.
The method I use to call my date (normally) is:
$row["added"]
So, now the code that I can't get to work.
This is the closest I've gotten, but it still isn't working.
$HourOffSet = "3";
$TimeMethod = "Y-m-d g:i A";
$TimeReadjust = ($HourOffSet 60 60);
$MyTimeZoned = date($TimeMethod,$row["added"] + $TimeReadjust);
echo $MyTimeZoned;
Can somebody please point out my error, and what I need to do to get it to print the date stored in the database PLUS the $HourOffSet.
Thanks.
JbA
(lastly, if anybody knows who wrote the above bit of code, can you please pass along their name & email for credit purposes!)