Working with date field

Events happening in the community are now at Drupal community events on www.drupal.org.
yorguey31's picture

Despite reading some documentation and looking to google on this subject i don't achiev to do the job ...
severals thing dont' goes well :
1)
$wrapper->my_date_field->value()
gives me a timestamp and not a datetime object.
2)
i can't find a way to get the value2 in my field
$wrapper->my_date_field->value2
$wrapper->my_date_field->value2->value()
$wrapper->my_date_field['value2']
$wrapper->my_date_field['value2']>value
doesn't work.
3)trying to set the date is a problem too
$wrapper->my_date_field->set()
$wrapper->my_date_field->value->set()
doesnt work :Unable to get a data value. Error: Unable to set the data property value as the parent data structure is not set.

Does someone has done this before ?

Entity API

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: