本文整理汇总了PHP中Formatter::dateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Formatter::dateTime方法的具体用法?PHP Formatter::dateTime怎么用?PHP Formatter::dateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Formatter
的用法示例。
在下文中一共展示了Formatter::dateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDateTimeEmpty
/**
* @covers Formatter::dateTime
*/
public function testDateTimeEmpty()
{
$actual = $this->formatter->dateTime(null, true, true);
$this->assertEmpty($actual);
}
示例2: notifications
public function notifications()
{
// Check if the notifications-app is available, if so, redirect there
if (file_exists(DIR_HOME . 'apps/notifications/information.php')) {
return $this->forward('app/notifications');
}
$json = array();
// Version check
$latestVersion = Communicator::getVersion();
if ($latestVersion != VERSION) {
$json['version'] = array('url' => 'http://www.sumostore.net/download', 'text' => '<i class="fa fa-exclamation-triangle"></i><strong>Download V' . $latestVersion . '</strong><span class="date">' . Formatter::dateTime(time()) . '</span>');
}
// Latest customer
$json['customer']['data'] = Database::query("SELECT firstname, middlename, lastname, gender, customer_id, date_added FROM PREFIX_customer ORDER BY date_added DESC LIMIT 1")->fetch();
if (empty($json['customer']['data'])) {
unset($json['customer']);
} else {
$json['customer'] = array('url' => $this->url->link('sale/customer/update', 'customer_id=' . $json['customer']['data']['customer_id'], 'SSL'), 'text' => Language::getVar('SUMO_ADMIN_LATEST_CUSTOMER_REGISTERED', array($json['customer']['data']['gender'] == 'm' ? 'male' : 'female', $json['customer']['data']['firstname'] . (!empty($json['customer']['data']['middlename']) ? ' ' . $json['customer']['data']['middlename'] . ' ' : ' ') . $json['customer']['data']['lastname'], Formatter::dateTime($json['customer']['data']['date_added'], false))));
}
// Latest order
$json['order']['data'] = Database::query("SELECT order_id, order_date, order_status FROM PREFIX_orders ORDER BY order_date DESC LIMIT 1")->fetch();
if (empty($json['order']['data'])) {
unset($json['order']);
} else {
$json['order'] = array('url' => $this->url->link('sale/order/info', 'order_id=' . $json['order']['data']['order_id'], 'SSL'), 'text' => Language::getVar('SUMO_ADMIN_LATEST_ORDER', array(Formatter::dateTime($json['order']['data']['order_date'], false))));
}
// Latest return
$json['return']['data'] = Database::query("SELECT return_id, date_added FROM PREFIX_return ORDER BY date_added DESC LIMIT 1")->fetch();
if (empty($json['return']['data'])) {
unset($json['return']);
} else {
$json['return'] = array('url' => $this->url->link('sale/return/info', 'return_id=' . $json['return']['data']['return_id'], 'SSL'), 'text' => Language::getVar('SUMO_ADMIN_LATEST_RETURN', array(Formatter::dateTime($json['return']['data']['date_added'], false))));
}
$this->response->setOutput(json_encode($json));
}