title: How do I get value of datetime object in drupal 8?
body: <p>There is a Datetime object as following and I want to get the date value </p>
  
  <pre>
  Array
  (
      [0] => Array
          (
              [value] => Drupal\Core\Datetime\DrupalDateTime Object
                  (
                      [formatTranslationCache:protected] => 
                      [inputTimeRaw:protected] => 
                      [inputTimeAdjusted:protected] => 
                      [inputTimeZoneRaw:protected] => 
                      [inputTimeZoneAdjusted:protected] => 
                      [inputFormatRaw:protected] => 
                      [inputFormatAdjusted:protected] => 
                      [langcode:protected] => en
                      [errors:protected] => Array
                          (
                          )
  
                      [dateTimeObject:protected] => DateTime Object
                          (
                              [date] => 2018-01-05 01:30:00.000000
                              [timezone_type] => 3
                              [timezone] => UTC
                          )
  
                      [stringTranslation:protected] => 
                  )
  
          )
  
  )
  </pre>
  
  <p>I don't want to get this value by <pre>$node->get("field_id")->value;</pre>
  Because I need dynamic value that means the value should change after I changed date field.
  Is it possible?</p>