localeDateTime() public method

Returns the date time in a particular format. Takes the locale into account.
public localeDateTime ( string | DateTime $dateTime, string $format = '%B %e, %Y %H:%M' ) : string
$dateTime string | DateTime
$format string
return string Formatted date and time
Example #1
0
 public function testLocaleDateTimeObjectWithFormat()
 {
     $app = $this->getApp();
     $handler = new TextHandler($app);
     $dateTime = new \DateTime('2012-06-14 09:07:55');
     $result = $handler->localeDateTime($dateTime, '%Y-%m-%d %H:%M');
     $this->assertSame('2012-06-14 09:07', $result);
 }