CodeIgniter Forums
date time error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: date time error (/showthread.php?tid=52786)



date time error - El Forum - 06-26-2012

[eluser]Unknown[/eluser]
hello i have a problem with date & time when i add events,
1) when i select date and time from admin panel like 2012/06/26 22:00 when i click send querry. as output in admin panel show 10:00 AM 2012 06 27 (next day morring date time) so my events dont remove automatic,
Code:
FILE : Add.php
Start Time :
&lt;input name="event_start" value="&lt;?php print date("Y-m-d H:i:s"); ?&gt;"&gt; <br>
End Time:
&lt;input name="event_end" value="&lt;?php print extendTime(date("Y-m-d H:i:s"), 2); ?&gt;" id="event_end"&gt;
FILE : list.php
list.php
<td>".getTime($event->event_start)." $start_gap </td>
    <td>".getTime($event->event_end)." $end_gap </td>



date time error - El Forum - 06-26-2012

[eluser]InsiteFX[/eluser]
You can try setting the timezone to your timezone.
Code:
// Backup timezone and set to GMT
$timezone_backup = date_default_timezone_get();
date_default_timezone_set("GMT");  // Examples: UTC, GMT, Atlantic/Azores

More here:
PHP Date

In CI you can set it to gmt time in the ./application/config/config.php file.



date time error - El Forum - 06-27-2012

[eluser]Unknown[/eluser]
Code:
strtotime(date("Y-m-d H:i:s"));
controllers folder evnt.php

in this format if i added 17:00 in admin panel as out put show me 5:00 am
if i add 5:00 curtime show 17:00 how to fix please help


date time error - El Forum - 06-27-2012

[eluser]InsiteFX[/eluser]
PHP date