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


PHP formatDate函数代码示例

本文整理汇总了PHP中formatDate函数的典型用法代码示例。如果您正苦于以下问题:PHP formatDate函数的具体用法?PHP formatDate怎么用?PHP formatDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了formatDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getGridData

 private function getGridData($gridId)
 {
     $grid = array('ID' => $gridId);
     $securityContext = $this->storage->getCurrentUserSecurityContext();
     $parameters = array('with' => array('FILE', 'CREATE_USER'), 'filter' => array('IS_EXPIRED' => false, 'OBJECT.STORAGE_ID' => $this->storage->getId(), 'CREATED_BY' => $this->getUser()->getId()));
     $parameters = Driver::getInstance()->getRightsManager()->addRightsCheck($securityContext, $parameters, array('OBJECT_ID', 'OBJECT.CREATED_BY'));
     $items = ExternalLink::getModelList($parameters);
     Collection::sortByColumn($items, array('CREATE_TIME' => array(SORT_NUMERIC, SORT_ASC)));
     $urlManager = Driver::getInstance()->getUrlManager();
     $rows = array();
     foreach ($items as $externalLink) {
         /** @var ExternalLink $externalLink */
         $exportData = $externalLink->toArray();
         $nameSpecialChars = htmlspecialcharsbx($externalLink->getFile()->getName());
         $createDateText = htmlspecialcharsbx((string) $externalLink->getCreateTime());
         $columnName = "\n\t\t\t\t<table class=\"bx-disk-object-name\"><tr>\n\t\t\t\t\t\t<td style=\"width: 45px;\"><div data-object-id=\"{$externalLink->getId()}\" class=\"draggable bx-file-icon-container-small bx-disk-file-icon\"></div></td>\n\t\t\t\t\t\t<td><a class=\"bx-disk-folder-title\" id=\"disk_obj_{$externalLink->getId()}\" href=\"\" data-bx-dateModify=\"{$createDateText}\">{$nameSpecialChars}</a></td>\n\t\t\t\t</tr></table>\n\t\t\t";
         $createdByLink = \CComponentEngine::makePathFromTemplate($this->arParams['PATH_TO_USER'], array("user_id" => $externalLink->getCreatedBy()));
         $rows[] = array('data' => $exportData, 'columns' => array('CREATE_TIME' => formatDate('x', $externalLink->getCreateTime()->getTimestamp(), time() + CTimeZone::getOffset()), 'UPDATE_TIME' => formatDate('x', $externalLink->getCreateTime()->getTimestamp(), time() + CTimeZone::getOffset()), 'NAME' => $columnName, 'FORMATTED_SIZE' => CFile::formatSize($externalLink->getFile()->getSize()), 'CREATE_USER' => "\n\t\t\t\t\t\t<div class=\"bx-disk-user-link\"><a target='_blank' href=\"{$createdByLink}\" id=\"\">" . htmlspecialcharsbx($externalLink->getCreateUser()->getFormattedName()) . "</a></div>\n\t\t\t\t\t"), 'actions' => array(array("PSEUDO_NAME" => "download", "DEFAULT" => true, "ICONCLASS" => "download", "TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DOWNLOAD'), "ONCLICK" => "jsUtils.Redirect(arguments, '" . $urlManager->getUrlForDownloadFile($externalLink->getFile()) . "')"), array("PSEUDO_NAME" => "disable_external_link", "ICONCLASS" => "disable_external_link", "TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DISABLE_EXTERNAL_LINK'), "SHORT_TEXT" => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_ACT_DISABLE_EXTERNAL_LINK_SHORT'), "ONCLICK" => "BX.Disk['ExternalLinkListClass_{$this->getComponentId()}'].disableExternalLink({$externalLink->getId()}, {$externalLink->getObjectId()})")));
     }
     unset($externalLink);
     $grid['MODE'] = 'list';
     $grid['HEADERS'] = array(array('id' => 'ID', 'name' => 'ID', 'default' => false, 'show_checkbox' => true), array('id' => 'NAME', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_NAME'), 'default' => true), array('id' => 'CREATE_TIME', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_CREATE_TIME'), 'default' => true), array('id' => 'CREATE_USER', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_CREATE_USER'), 'default' => false), array('id' => 'FORMATTED_SIZE', 'name' => Loc::getMessage('DISK_EXTERNAL_LINK_LIST_COLUMN_FORMATTED_SIZE'), 'default' => true));
     $grid['ROWS'] = $rows;
     $grid['ROWS_COUNT'] = count($rows);
     $grid['FOOTER'] = array();
     return $grid;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:27,代码来源:class.php

示例2: getData

 /**
  * Name: getData
  * 
  * @param type $url link za paginaciju
  * @param type $cookie_name naziv kolacica
  * @param type $is_archive da li je anketa arhivira ili nije; 1 - jeste, 0 - nije
  */
 function getData($url, $cookie_name, $is_archive = 0)
 {
     $q = get_cookie($cookie_name);
     $perPage = $this->input->post('perPage');
     $perP = $perPage ? $perPage : $q;
     $has_error = 0;
     $message = __('Uspesno dobavljeni podaci!!', $this->template['module']);
     // var_dump($message); exit;
     if (is_numeric($this->anketa->getTotalRows($is_archive))) {
         pagination($url, $this->anketa->getTotalRows($is_archive), $perP, '4', 'ankete');
     } else {
         $has_error = 2;
         $message = "Doslo je do greske.";
     }
     $page = uri_segment('4');
     if (!($data = $this->anketa->fetch_ankete($perP, $page, $is_archive))) {
         $has_error = 1;
         $message = __('Trenutno nema anketa!!! Unesite anketu klikom na', $this->template['module']);
     }
     if (!empty($data)) {
         $redni_broj = isset($page) ? $page : 0;
         foreach ($data as $anketa) {
             $anketa->datum_kreiranja = formatDate($anketa->datum_kreiranja);
             $anketa->redni_broj = ++$redni_broj;
         }
     }
     $links = create_links();
     $uri = $page;
     $result = array('data' => $data, 'links' => $links, 'error' => $has_error, 'uri' => $uri, 'poruka' => $message);
     $this->response($result);
 }
开发者ID:savicdragan15,项目名称:anketa,代码行数:38,代码来源:admin.php

示例3: testa_user

 function testa_user($s_usuario, $s_nivel, $s_nivel_desc, $permissao, $help = '')
 {
     if (!isset($_SESSION['s_logado']) || $_SESSION['s_logado'] == 0) {
         print "<script>window.open('../../index.php','_parent','')</script>";
         exit;
     } else {
         //print "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>";
         if ($help != '') {
             $help = "&nbsp;<a><img align='absmiddle' src='" . ICONS_PATH . "help-16.png' width='16' height='16' border='0' onClick=\"return popupS('" . HELP_PATH . "" . $help . "')\"></a>";
         }
         if ($s_nivel > $permissao) {
             $this->saida = "<script>window.open('../../index.php','_parent','')</script>";
             exit;
         } else {
             if (is_file("./.invmon_dir")) {
                 $this->texto = TRANS('MENU_TTL_MOD_INV');
             } else {
                 if (is_file("./.admin_dir")) {
                     $this->texto = TRANS('MENU_TTL_MOD_ADMIN');
                 } else {
                     $this->texto = TRANS('MENU_TTL_MOD_OCCO');
                 }
             }
             $this->saida = "<TABLE class='header_centro' cellspacing='1' border='0' cellpadding='1' align='center' width='100%'>" . "<TR>" . "<TD nowrap width='75%'><b>" . $this->texto . "</b></td>" . "<td width='25%' nowrap><p class='parag' align='right'><b>" . TRANS(date("l")) . ",&nbsp;" . formatDate(date("Y/m/d H:i"), " %H:%M") . "</b>" . $help . "</p></TD>";
             $this->saida .= "</TR>" . "</TABLE>";
         }
         print $this->saida;
     }
 }
开发者ID:JusCes,项目名称:ocomonv3,代码行数:29,代码来源:auth.class.php

示例4: view

 /**
  * Returns (safe) HTML which displays a field
  * @access public
  * @param array $task task data
  * @param array $parents parents for a category item
  * @param bool $plain this is **not** meant to be safe, but basically to display content where HTML tags are disturbing
  * @return string
  */
 function view($task = array(), $parents = array(), $plain = false)
 {
     if (!isset($task['field' . $this->id]) || !$task['field' . $this->id]) {
         $html = sprintf('<span class="fade">%s</span>', eL('notspecified'));
     } else {
         $html = '';
         switch ($this->prefs['field_type']) {
             case FIELD_LIST:
                 if ($this->prefs['list_type'] == LIST_CATEGORY && isset($parents[$this->id])) {
                     foreach ($parents[$this->id] as $cat) {
                         $html .= Filters::noXSS($cat) . '&#8594;';
                     }
                 }
                 $html .= Filters::noXSS($task['field' . $this->id . '_name']);
                 break;
             case FIELD_DATE:
                 $html .= formatDate($task['field' . $this->id]);
                 break;
             case FIELD_TEXT:
                 $html .= Filters::noXSS($task['field' . $this->id]);
                 break;
             case FIELD_USER:
                 $html .= Filters::noXSS($task['field' . $this->id . '_name']);
                 break;
         }
     }
     return $plain ? strip_tags(htmlspecialchars_decode($html, ENT_QUOTES)) : $html;
 }
开发者ID:negram,项目名称:flyspray,代码行数:36,代码来源:class.field.php

示例5: getExperienceEnd

function getExperienceEnd($date)
{
    if ($date == 0) {
        return "Present";
    } else {
        return formatDate($date);
    }
}
开发者ID:erick305,项目名称:testing,代码行数:8,代码来源:student.php

示例6: prepareComment

function prepareComment($msg, $timestamp, $uid, $cid, $event_id)
{
    $date = formatDate($timestamp);
    // $time = formatDate($timestamp);
    $name = getUserName($uid);
    $msg = formatMsg($msg);
    $delbtn = deleteBtnComment($cid, $uid, $event_id);
    return "<div class='eventComment'>\n                <span style='font-size:50%;'>\n                    <span>{$date}</span>\n                    &nbsp;&nbsp;\n                    |\n                    &nbsp;&nbsp;\n                    <span style='font-size:75%;'>\n                        {$name}</span>\n                    </span>\n                    <span>\n                        {$delbtn}\n                        </span>\n                <br />\n                <span class='eventCommentText'>\n                    " . strip_tags($msg) . "\n                </span>\n            </div>\n            ";
}
开发者ID:nainapjj,项目名称:waanoo,代码行数:9,代码来源:get_event_comments.php

示例7: dayReferance

function dayReferance($date, $format = "d-m-Y")
{
    if (formatDate($date) == formatDate(getCurrentDateTime())) {
        return "Today";
    } elseif (formatDate($date) == formatDate(getPreviousDate(getCurrentDateTime()))) {
        return "Yesterday";
    } else {
        return formatDate($date, $format);
    }
}
开发者ID:aranyak-banerjee,项目名称:eetpl-connect,代码行数:10,代码来源:commonFunctions_helper.php

示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     $data = Input::All();
     $data['tanggal'] = formatDate($data['tanggal']);
     $riwayat = new Seminar($data);
     if ($riwayat->save()) {
         return Response::json(array('success' => true));
     }
 }
开发者ID:shinichi81,项目名称:angular-simpeg,代码行数:15,代码来源:SeminarController.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     $data = Input::All();
     $data['tanggal_sertifikat'] = formatDate($data['tanggal_sertifikat']);
     $riwayat = new PelatihanPegawai($data);
     if ($riwayat->save()) {
         return Response::json(array('success' => true));
     }
 }
开发者ID:shinichi81,项目名称:angular-simpeg,代码行数:15,代码来源:PelatihanPegawaiController.php

示例10: getList

 public function getList($newsletterID = 0)
 {
     $db = MySQL::getInstance();
     $db->query("SELECT c.CommentID, c.Content, c.LeftKey, u.Name, u.Email, c.Created,\n\t\t\t\tIF (c.Level > 20, 20, c.Level) AS Level\n\t\t\tFROM `newsletter_comment` AS c\n\t\t\t\tINNER JOIN `newsletter` AS n ON n.NewsletterID = c.NewsletterID\n\t\t\t\tINNER JOIN `user` AS u ON c.UserID = u.UserID\n\t\t\tWHERE c.NewsletterID=" . $db->escape((int) $newsletterID) . "\n\t\t\tORDER BY c.LeftKey");
     $items = array();
     while ($row = $db->fetchRow()) {
         $row['Date'] = formatDate($row['Created'], 'j F Y в H:i');
         $items[] = $row;
     }
     return new Object($items);
 }
开发者ID:kizz66,项目名称:meat,代码行数:11,代码来源:Comment.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     $data = Input::All();
     $data['tanggal_sttb'] = formatDate($data['tanggal_sttb']);
     $data['tanggal_lulus'] = formatDate($data['tanggal_lulus']);
     $pendidikan = new Pendidikan($data);
     if ($pendidikan->save()) {
         return Response::json(array('success' => true));
     }
 }
开发者ID:shinichi81,项目名称:angular-simpeg,代码行数:16,代码来源:PendidikanController.php

示例12: editperiod_GET

function editperiod_GET(Web $w)
{
    list($periodid) = $w->pathMatch("a");
    $period = new BendWorkPeriod($w);
    if (!empty($periodid)) {
        $period = $w->Bend->getWorkPeriodForId($periodid);
    }
    $form["Work Period"] = array(array(array("Date From", "date", "d_start", !empty($period->d_start) ? formatDate($period->d_start) : ""), array("Date To", "date", "d_end", !empty($period->d_end) ? formatDate($period->d_end) : "")), array(array("Monthly Person Hours", "text", "monthly_person_hours", $period->monthly_person_hours), array("Is Closed?", "select", "is_closed", $period->is_closed, booleanNoYesForSelect())));
    $w->setLayout(null);
    $w->out(Html::multiColForm($form, "/bend-workhours/editperiod/{$periodid}", "POST", "Save"));
}
开发者ID:careck,项目名称:bendms,代码行数:11,代码来源:editperiod.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     $data = Input::All();
     $data['tanggal_sk'] = formatDate($data['tanggal_sk']);
     $data['tanggal_mulai'] = formatDate($data['tanggal_mulai']);
     $data['tanggal_selesai'] = formatDate($data['tanggal_selesai']);
     $riwayat = new RiwayatJabatan($data);
     if ($riwayat->save()) {
         return Response::json(array('success' => true));
     }
 }
开发者ID:shinichi81,项目名称:angular-simpeg,代码行数:17,代码来源:RiwayatJabatanController.php

示例14: showperiod_GET

function showperiod_GET(Web $w)
{
    list($id) = $w->pathMatch("a");
    $wp = $w->Bend->getWorkperiodForId($id);
    if (empty($wp)) {
        $w->error("Workperiod does not exist", "/bend-workhours/admin");
    }
    History::add("Work Period: " . formatDate($wp->d_start));
    $w->ctx("workperiod", $wp);
    $w->ctx("categories", $w->Bend->getTopLevelWorkCategories());
    $w->ctx("households", $w->Bend->getAllHouseholds());
}
开发者ID:careck,项目名称:bendms,代码行数:12,代码来源:showperiod.php

示例15: execute

 public function execute($dataContainer)
 {
     //No direct access
     defined('_WEXEC') or die("Access denied");
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     require_once PATH_ACCESS . '/OrderManager.php';
     require_once PATH_ACCESS . '/MealManager.php';
     $smarty = $dataContainer->getSmarty();
     $orderManager = new OrderManager('BabeskOrders');
     $mealManager = new MealManager('BabeskMeals');
     $meal = array();
     $orders_existing = true;
     $meal_problems = false;
     $mealHistory = array();
     try {
         $orders = $orderManager->getAllOrdersOfUser($_SESSION['uid'], strtotime(date('Y-m-d')));
     } catch (MySQLVoidDataException $e) {
         $smarty->assign('error', 'Keine Bestellungen vorhanden.');
         $orders_existing = false;
     } catch (Exception $e) {
         die('Error: ' . $e);
     }
     if ($orders_existing) {
         $today = date('Y-m-d');
         $hour = date('H', time());
         $this->_lastCancel = $this->lastOrdercancelDatemodGet();
         foreach ($orders as $order) {
             try {
                 $mealname = $mealManager->getEntryData($order['MID'], 'name');
             } catch (MySQLVoidDataException $e) {
                 $meal_problems = true;
                 $smarty->assign('error', '<p class="error">Zu bestimmten Bestellung(-en) fehlen Daten einer Mahlzeit! Bitte benachrichtigen sie den Administrator!</p>');
                 continue;
             }
             if (!$order['fetched'] and $order['date'] >= $today) {
                 //fetch last_order_time from database and compare with actual time
                 $hour = date('H:i', time());
                 $cancelAllowed = $this->isAllowedToCancel($order['date']);
                 $meal[] = array('date' => formatDate($order["date"]), 'name' => $mealname["name"], 'orderID' => $order['ID'], 'cancel' => $cancelAllowed);
             } else {
                 $mealHistory[] = array('date' => formatDate($order["date"]), 'name' => $mealname["name"], 'orderID' => $order['ID'], 'cancel' => false, 'fetched' => $order['fetched']);
             }
         }
     }
     if (!count($meal) && !count($mealHistory) && !$meal_problems) {
         //no new meals there
         $smarty->assign('error', 'Keine Bestellungen vorhanden.');
     }
     $smarty->assign('meal', $meal);
     $smarty->assign('mealHistory', $mealHistory);
     $smarty->display($this->smartyPath . 'menu.tpl');
 }
开发者ID:babesk,项目名称:babesk,代码行数:52,代码来源:Menu.php


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