Get current user's date |
[eluser]bondjp[/eluser]
Hi, I need to check what's the current date where the user is in. I don't need the time, just the current date. How can i do it? Thanks.
[eluser]LuckyFella73[/eluser]
http://www.codeproject.com/KB/scripting/...vreme.aspx
[eluser]Rey Philip Regis[/eluser]
You need to use javascript if you want to check the users current date.... remember that php is server side and javascript is client side. So you will need to use javascript for that....
[eluser]bondjp[/eluser]
I managed to get the users date. Now i have a problem where i can't get strtotime to parse it. The date is shown correctly [removed] Code: function getthedate(){
[eluser]bondjp[/eluser]
Ok. think i know what's going on. Since php is server side when the page displays, the variable has nothing and therefore strtotime gives 0. I see that the strtotime displays 0 and then after a 1-2 seconds i get the value displayed from the $curdate variable. I'm trying to send that value when i submit the form so that i get the current value from the client side but i'm still getting 0 when using strtotime(date shows as 1970-01-01). Here's the part of the form where i insert the date: Code: <?php Shouldn't the updated value of $curdate be passed with the form when i click submit?
[eluser]bondjp[/eluser]
Still trying to get the variable to pass to the controller. Here's my latest code: Code: $(document).ready(function() { Controller: Code: $curdate=$this->input->post('curdate'); What i'm doing wrong? Anyone can help me on this one? Thanks. |
Welcome Guest, Not a member yet? Register Sign In |