Google\Cloud\BigQuery\Date::formatAsString PHP Method

formatAsString() public method

Format the value as a string.
public formatAsString ( ) : string
return string
    public function formatAsString()
    {
        return $this->value->format(self::FORMAT);
    }

Usage Example

 public function testStringFormatting()
 {
     $value = new \DateTime();
     $date = new Date($value);
     $expected = $value->format('Y-m-d');
     $this->assertEquals($expected, (string) $date);
     $this->assertEquals($expected, $date->formatAsString());
 }