i want retrieve date from database(s_start) and convert it to Specific time zone like (Africa/Cairo) according to user time zone from database (s_timezone) i can only retrieve orginal date stored in database and i can't convert the result My controller code :
$this->db->select('s_id');
$this->db->select('s_start');
$this->db->from('sessions');
$query = $this->db->get($this->event);
if ($query) {
return $query->result();
}
return NULL;
html code :
<div id="cal-slide-content" class="cal-event-list">
<ul class="unstyled list-unstyled">
<% _.each(events, function(event) { %>
<li>
<span class="pull-left event <%= event['s_start'] %>">
</span>
<a href="" data-event-id="<%= event.id %>"
data-event-class="<%= event['class'] %>" class="event-
item">
<%= event.s_start %> <%= event.u_timezone %>
(<%= event.u_name %>)
</a>
</li>
<% }) %>
</ul>
}
Resources
Edit A function in the controller to convert timezones.
Now you can echo the result