CodeIgniter Forums
date related problem - 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 related problem (/showthread.php?tid=53130)



date related problem - El Forum - 07-12-2012

[eluser]dhananjay[/eluser]
i have a table in database which have a column that is type of date

i m getting current date using this code but its inserting date , on local host and hostgator server both 2007-12-12

Code:
$this->load->helper('date');
'date'=> date("m.d.y"),


any one can help me to get correct current date i will be much obliged.......


date related problem - El Forum - 07-12-2012

[eluser]InsiteFX[/eluser]
Code:
// get current date
$cur_date = date('Y-m-d');

// get current time
$cur_time = date('H:i:s');

// get current date and time
$now = date('Y-m-d H:i:s');



date related problem - El Forum - 07-12-2012

[eluser]dhananjay[/eluser]
Thanks a lot

it worked

date('Y-m-d')