Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I create an entity wrapper from a loaded node object like this: $node_wrapper = entity_metadata_wrapper($node)
.
Now to work with dates I'd expect to have date field values also wrapped to get DateObjects but this is not the case, instead we have arrays like this:
value = "2016-05-10 09:00:00"
value2 = "2016-05-10 10:00:00"
timezone = "Europe/Moscow"
timezone_db = "UTC"
date_type = "datetime"
which looks a bit confusing having two different timezones in the same array. So the question is: how to create DateObject or how to create a wrapper for DateObject and do this properly?
Comments
Comment #2
steinmb CreditAttribution: steinmb as a volunteer commented