当前位置: 首页>>代码示例>>PHP>>正文


PHP Formatter::dateTime方法代码示例

本文整理汇总了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);
 }
开发者ID:fruition-sciences,项目名称:phpfw,代码行数:8,代码来源:FormatterTest.php

示例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));
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:35,代码来源:home.php


注:本文中的Formatter::dateTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。