How can I record the timestamp in accordance to the user's timezone settings?
For example:
Thank you so much!
Here is my code you can test to see what I mean.
$my_tz = "UP3";
$utc_time = local_to_gmt(time());
$current_time = gmt_to_local($utc_time, $my_tz, FALSE);
echo "Current Time: ".unix_to_human($current_time)."</br>";
echo $current_time;
echo "</br></br></br></br>";
$time_to_set = "2017-05-31 03:15 PM";
$time_set_unix = human_to_unix($time_to_set);
$time_to_normal = local_to_gmt($time_set_unix, "UP8", FALSE);
echo $time_to_set."</br>";
echo $time_set_unix."</br>";
echo $time_to_normal."</br>";
echo unix_to_human($time_to_normal)."</br>";
I solved my issue. I ditched the CI Date Helper and opted for the default PHP one. It is much better than going through trial and error and always getting an offset that is way off the actual time.
@astound's answer also helped in this.