I've read many posts about the question I posted here but I'm encountering a strange issue.
I've set my PHP server timezone to "Asia/Bangkok"
(just an example) using date.timezone
directive in php.ini
file which works quite fine.
The server returns correct time based on set time zone when I simply print the time as
<?php echo date("F j, Y, g:i A"); ?>
But when I want to print a series of time dynamically, inputted into mysql
database during user entry like,
<?php echo date("F j, Y g:i A", strtotime($row_entries['input_time']));?>
The server returns the system
time based on the timezone set by host which is Europe/Dublin
(just an example).
I even tried to print the time without strtotime
function like,
<?php echo date("F j, Y g:i A",($row_entries['post_time']));?>
That returns abnormal/invalid date.
What's going wrong here and how could I print time dynamically based on server time zone I set in php.ini
?