original_string: protected function formatDateCellValue($node)
      {
          // The XML node looks like this:
          // <table:table-cell calcext:value-type="date" office:date-value="2016-05-19T16:39:00" office:value-type="date">
          //   <text:p>05/19/16 04:39 PM</text:p>
          // </table:table-cell>
  
          if ($this->shouldFormatDates) {
              // The date is already formatted in the "p" tag
              $nodeWithValueAlreadyFormatted = $node->getElementsByTagName(self::XML_NODE_P)->item(0);
              return $nodeWithValueAlreadyFormatted->nodeValue;
          } else {
              // otherwise, get it from the "date-value" attribute
              try {
                  $nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_DATE_VALUE);
                  return new \DateTime($nodeValue);
              } catch (\Exception $e) {
                  return null;
              }
          }
      }
code: protected function formatDateCellValue($node)
      {
          // The XML node looks like this:
          // <table:table-cell calcext:value-type="date" office:date-value="2016-05-19T16:39:00" office:value-type="date">
          //   <text:p>05/19/16 04:39 PM</text:p>
          // </table:table-cell>
  
          if ($this->shouldFormatDates) {
              // The date is already formatted in the "p" tag
              $nodeWithValueAlreadyFormatted = $node->getElementsByTagName(self::XML_NODE_P)->item(0);
              return $nodeWithValueAlreadyFormatted->nodeValue;
          } else {
              // otherwise, get it from the "date-value" attribute
              try {
                  $nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_DATE_VALUE);
                  return new \DateTime($nodeValue);
              } catch (\Exception $e) {
                  return null;
              }
          }
      }
code_tokens: protected function formatDateCellValue ( $ node ) { // The XML node looks like this: // <table:table-cell calcext:value-type="date" office:date-value="2016-05-19T16:39:00" office:value-type="date"> //   <text:p>05/19/16 04:39 PM</text:p> // </table:table-cell> if ( $ this -> shouldFormatDates ) { // The date is already formatted in the "p" tag $ nodeWithValueAlreadyFormatted = $ node -> getElementsByTagName ( self :: XML_NODE_P ) -> item ( 0 ) ; return $ nodeWithValueAlreadyFormatted -> nodeValue ; } else { // otherwise, get it from the "date-value" attribute try { $ nodeValue = $ node -> getAttribute ( self :: XML_ATTRIBUTE_DATE_VALUE ) ; return new \ DateTime ( $ nodeValue ) ; } catch ( \ Exception $ e ) { return null ; } } }
docstring: Returns the cell Date value from the given node.
  
  @param \DOMNode $node
  @return \DateTime|string|null The value associated with the cell or NULL if invalid date value
docstring_tokens: Returns the cell Date value from the given node .