本文整理汇总了PHP中formatDate函数的典型用法代码示例。如果您正苦于以下问题:PHP formatDate函数的具体用法?PHP formatDate怎么用?PHP formatDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formatDate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 = " <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")) . ", " . 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) . '→';
}
}
$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 \n |\n \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
示例16: getTagHeadline
public function getTagHeadline($whereCond = '', $offset = 0, $limit = 5)
{
if ($whereCond) {
$this->where($whereCond);
}
$this->limit($offset, $limit);
$this->orderby(array('tag_order' => 'ASC'));
$row = $this->get($this->table);
foreach ($row as $no => $r) {
$row[$no]['date_modified_formated'] = formatDate($r['date_modified'], 2);
}
return $row;
}
开发者ID:cyberorca,项目名称:dfp-api,代码行数:13,代码来源:tags_model.php
示例17: getLast12Months
function getLast12Months($format = "%b %Y")
{
$currentDate = today();
$currentMonth = formatDate($currentDate, "%m");
$currentYear = formatDate($currentDate, "%Y");
$startingYear = $currentYear - 1;
$last_12_months = array();
for ($i = (int) $currentMonth + 1; $i <= 12; $i++) {
$last_12_months[] = formatDate($startingYear . "-" . $i . "-01", $format);
}
for ($i = 1; $i <= $currentMonth; $i++) {
$last_12_months[] = formatDate($currentYear . "-" . $i . "-01", $format);
}
return $last_12_months;
}
开发者ID:nveeed,项目名称:ems,代码行数:15,代码来源:DateTimeHelper.php
示例18: editworkentry_GET
function editworkentry_GET(Web $w)
{
list($workentry_id) = $w->pathMatch("id");
if (empty($workentry_id)) {
$w->error("Missing an ID");
}
$workentry = $w->Bend->getWorkEntryForId($workentry_id);
if (empty($workentry)) {
$w->error("No work entry found for this id: " . $workentry_id);
}
$category = $workentry->getWorkCategory();
list($category_1, $category_2, $category_3) = $category->getPath();
$form["Work Hours"] = array(array($w->Auth->hasRole("bend_admin") ? array("Who did the work?", "select", "user_id", $workentry->user_id, $w->Bend->getOccupantUsers()) : array("Who did the work?", "static", "", $w->Auth->getUser($workentry->user_id)->getFullName()), array("Who to credit to", "select", "attributed_user_id", $workentry->attributed_user_id, $w->Bend->getOccupantUsers()), array("Date", "date", "d_date", formatDate($workentry->d_date)), array("Hours", "text", "hours", $workentry->hours)), array(array("Focus Group", "select", "category_1", defaultVal($category_1->id), $w->Bend->getTopLevelWorkCategories()), array("Team or Activity", "select", "category_2", defaultVal($category_2->id), !empty($category_1) ? $category_1->getChildren() : null), array("Activity", "select", "category_3", defaultVal($category_3->id), !empty($category_2) ? $category_2->getChildren() : null)), array(array("Description", "text", "description", $workentry->description)));
$w->ctx("form", Html::multiColForm($form, "/bend-workhours/editworkentry/{$workentry_id}", "POST", "Save"));
}
开发者ID:careck,项目名称:bendms,代码行数:15,代码来源:editworkentry.php
示例19: 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']);
$diff = getDateDiff($data['tanggal_mulai'], $data['tanggal_selesai']);
if ($diff->y > 0) {
$data['masa_berlaku'] = $diff->y . ' Tahun ' . $diff->m . ' Bulan';
}
$riwayat = new HukumanPegawai($data);
if ($riwayat->save()) {
return Response::json(array('success' => true));
}
}
开发者ID:shinichi81,项目名称:angular-simpeg,代码行数:21,代码来源:HukumanPegawaiController.php
示例20: getByID
public function getByID($newsletterID)
{
$db = MySQL::getInstance();
$db->query("SELECT n.*, IF (c.Count, c.Count, 0) AS CommentCount\n\t\t\tFROM newsletter AS n\n\t\t\t\tLEFT JOIN newsletter_comment_count AS c ON c.NewsletterID = n.NewsletterID\n\t\t\tWHERE n.NewsletterID = " . $db->escape((int) $newsletterID));
$item = array();
if ($db->numRows() > 0) {
$item = $db->fetchRow();
$item['DateFormat'] = formatDate($item['Date'], 'Y-m-d');
$oCommentList = new Newsletter_Comment();
$item['CommentList'] = $oCommentList->getList((int) $newsletterID);
$oImageList = new Newsletter_Image();
$item['ImageList'] = $oImageList->getList((int) $newsletterID);
} else {
return false;
}
return new Object($item);
}
开发者ID:kizz66,项目名称:meat,代码行数:17,代码来源:Newsletter.php
注:本文中的formatDate函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论