Hi,
I had problem I assigned meal timings to certain menu items, but it was not working.!
Finally with some troubleshoot I figured the problem. Timezone on mysql was '-05:00' and I want '+03:00'
mysql hosted on hostgator server, I tried to reset the timezone to my timzone but failed.
So I changed the code to retrieve current time from mysql to my timezone using the below code.
$this->db->select('IF(start_time <= time(convert_tz(now(),"-05:00","+03:00")), IF(end_time >= time(convert_tz(now(),"-05:00","+03:00")), "1", "0"), "0") AS is_mealtime', FALSE);
time(convert_tz(now(),"-05:00","+03:00")) used instead of current_time()
How I can set timezone without changing code? Any help will be appreciated.
The quick hard code for the issue is posted myself. But let me know by anyway i can improve the code