![]() |
adding datetime in mysql with codeigniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: adding datetime in mysql with codeigniter (/showthread.php?tid=39718) |
adding datetime in mysql with codeigniter - El Forum - 03-18-2011 [eluser]dhaulagiri[/eluser] hello friends, how do i add datetime ( not current timestamp) but any date and time in 'datetime' field of mysql database in the format 2011-03-18 18:37:06 from php ? does jquery calendar allow time as well or what is the easy way to do so ? any help would be greatly appreceated. Thanks adding datetime in mysql with codeigniter - El Forum - 03-18-2011 [eluser]Total Shop UK[/eluser] You mean like Code: date('Y-m-d H:i:s',strtotime($date)) adding datetime in mysql with codeigniter - El Forum - 03-18-2011 [eluser]InsiteFX[/eluser] Code: public function add_post() See pub_date InsiteFX adding datetime in mysql with codeigniter - El Forum - 03-18-2011 [eluser]dhaulagiri[/eluser] what if i want to add date and time for 1 week later or after 25 days later , i am not talking abt timestamp, i want to add date and time for later than NOW() adding datetime in mysql with codeigniter - El Forum - 03-19-2011 [eluser]osci[/eluser] You can use mktime function to create manually the timestamp you need. Then you'll use date function as insiteFX posted with extra argument the value returned by mktime. |