[wp-hackers] Date not converting/saving in post meta correctly

Mitch Canter mitch at mitchcanter.com
Tue Jun 21 15:17:44 UTC 2011


http://pastebin.com/2WZyG940 

I’ve pasted the code above because for some reason when I update the post, the “start date” doesn’t save into the meta as unixtime as it should – it only saves as a string, and I end up getting errors.  The “end date” does,  and that’s what’s confusing the heck out of me.  

Server is running php5 and apache on a bluehost shared install, if that helps.

Warning: date() expects parameter 2 to be long, string given in /home5/ccfedmon/public_html/wp-content/themes/ccfchurch/functions.php on line 468

Warning: date() expects parameter 2 to be long, string given in /home5/ccfedmon/public_html/wp-content/themes/ccfchurch/functions.php on line 470 

That’s what pops up in the editor (those numbers won’t match up to the functions.php because I’ve only brought in the code that deals with that specific area... but here’s the lines in question):

468 - $clean_sd = date("D, M d, Y", $meta_sd);
469 - $clean_ed = date("D, M d, Y", $meta_ed);
470 - $clean_st = date($time_format, $meta_st);
471 - $clean_et = date($time_format, $meta_et);

I’m stumped.  Any ideas would be fantastic.


More information about the wp-hackers mailing list