timestamp woes |
[eluser]jbads[/eluser]
Hi, I'm having trouble with some dates and hopefully someone could shed some light. On my form users can enter 2 dates: the date that they would like their advertisment to become live on my website and a date for the event they are advertising. This is the code in my controller for converting the input dates to timestamps: Code: $e_date = $this->input->post('event_date_day').'/'.$this->input->post('event_date_month').'/'.$this->input->post('event_date_year'); If I echo out these variables. I get this: Code: print_r($a_date); Quote:25/09/08 Array ( [0] => 25 [1] => 09 [2] => 08 ) 1222257601 04/12/08 Array ( [0] => 04 [1] => 12 [2] => 08 ) 1228302001 I would like to create a timestamp for 1 second past 12am on the date the user entered. However when I put the generated timestamps into a timestamp converter I get Wed, 24 Sep 2008 12:00:01 GMT (should be 25 sep 2008 00:00:01) and Wed, 03 Dec 2008 11:00:01 GMT (should be 04 dec 2008 00:00:01)
[eluser]Aken[/eluser]
Look into this PHP function to set your timezone: date_default_timezone_set() |
Welcome Guest, Not a member yet? Register Sign In |