![]() |
dealing with codeigniter date helper - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: dealing with codeigniter date helper (/showthread.php?tid=24960) |
dealing with codeigniter date helper - El Forum - 11-25-2009 [eluser]basty_dread[/eluser] Hello Guys. i'm here again to ask for your favor, strategies about my problem with date this is what i want to do: I have a registration form when this user click the register button the system saves all the information that has been entered. my question is, how can i save the current date and time of the user on his or her timezone? plus his/her account is limited, how can i add let say 6 months and save to the database the expiration of his/her account. i hope you guys can help me.. thank you very much. dealing with codeigniter date helper - El Forum - 11-26-2009 [eluser]basty_dread[/eluser] help help... dealing with codeigniter date helper - El Forum - 11-26-2009 [eluser]Flemming[/eluser] this will help you get the user's time: http://stackoverflow.com/questions/13/how-can-i-determine-a-web-users-time-zone Once you have that you can look at the MySQL function date_add() to calculate a date 6 months in the future. Hope that helps you? ========================== EDIT: scratch that ... I think this may work (please note this is totally untested!) ... You will need to include jquery.js In the head of your view: Code: < script type="text/javascript" scr="jquery.js" > </ script > your controller: Code: function store_user_time($user_date) the jQuery $.post calls your controller which stores the date in a CI session. If it works you can develop it to add in the user's time as well. Hope it helps you! |