In flex (flash builder 4) I have a Date() property that I am passing to Zend AMF (php) and I want to store that (as well as other data) in mongoDB.
Mongodb is complaining about the date because it comes across as a Zend_Date object, which appears to be an object containing several properties and Mongodb is saying that it can not accept blank properties.
So, I take that to mean it needs to be converted to something else before I can store it?
If so, how do I do that?
At the moment I have taken the approach of converting the Zend_Date object in to a date string to store it (in php):
$object->readyDT=date("m/d/Y H:i", strtotime($object->readyDT)); //convert to string
That works fine, and I have a string in mongodb of that date.
Now, when I load the date from MongoDB, I need to convert it back to a Zend_Date so it properly converts back in to a Date() object in flex (I have to check that it's not blank or it throws errors in php):
if (isset($object->readyDT) && $object->readyDT!=="") $object->readyDT = new Zend_Date($object->readyDT, 'MM/dd/yyyy hh:mm');
This all works, but it seems like there should be a much easier way to take a Date() from flex and get it stored in MongoDB via Zend AMF/PHP. ?