writing time of a day
I am trying to create a specific time on a specific date. For example, 09:00 on October 31, 2008.
The problem: I have a specific date and time say 23:00, Oct 31, 2008 stored as a string. I want to set time to 09:00.
I have tried using date_parse, and mktime to do the job but they are giving me strange outputs as 1969-12-31 19:00:00, it should be 2008-10-16 17:00:00.
If I break the function down (using strtotime), I can see the correct hours, min, sec, month, day, and year. It is hard to understand that if I pass on these to mktime or use date_parse, the functions are giving me wrong output.
variable storing date = string(19) "2008-10-31 23:00:00"
I get the right month, day, year, hours, min, sec if I use date and strtotime. Why am I getting wrong output with date_parse and mktime?
Can anyone offer a hand ?
|