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


PHP TimeDate::toDisplayDateTime方法代码示例

本文整理汇总了PHP中TimeDate::toDisplayDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP TimeDate::toDisplayDateTime方法的具体用法?PHP TimeDate::toDisplayDateTime怎么用?PHP TimeDate::toDisplayDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimeDate的用法示例。


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

示例1: display


//.........这里部分代码省略.........
            echo $tags;
            ?>
 width="33%"><?php 
            echo $jLang['_COM_TIPS_TIPPING_CLOSE'];
            ?>
</th>
			<?php 
            if ($jTips['ShowJSCountdown'] == 1) {
                ?>
				<th <?php 
                echo $tags;
                ?>
 width="34%"><?php 
                echo $jLang['_COM_TIPS_TIME_TO_CLOSE'];
                ?>
</th>
				<?php 
            }
            ?>
				<th <?php 
            echo $tags;
            ?>
 width="33%"><?php 
            echo $jLang['_COM_TIPS_LASTUP'];
            ?>
</th>
				</tr>
			</thead>
			<tbody>
				<tr class="sectiontableentry1">
				<td style="text-align:center;">
				<?php 
            //BUG 136 - show closed/closes depending on start time
            echo TimeDate::toDisplayDateTime($this->jRound->start_time, false);
            ?>
</td>
				<?php 
            if ($jTips['ShowJSCountdown'] == 1) {
                ?>
				<td><div id='countdown' style="text-align:center;" class="highlight"><?php 
                echo $jLang['_COM_CLOSED'];
                ?>
</div></td>
			<?php 
            }
            $jTipParams = array('game_id' => array('type' => 'reference', 'query' => "SELECT DISTINCT id FROM #__jtips_games WHERE round_id = " . $this->jRound->id), 'user_id' => $jTipsCurrentUser->id);
            $jTip = new jTip($database);
            $jTipss = forceArray($jTip->loadByParams($jTipParams));
            ?>
<td><?php 
            if (count($jTipss) > 0) {
                echo TimeDate::toDisplayDateTime($jTipss[0]->updated, false);
            } else {
                echo "&nbsp;";
            }
            ?>
			</td>
			</tr>
			</tbody>
			</table>
			<?php 
            if (jTipsGetParam($jTips, 'TeamLadderPopup', 0)) {
                $url = "view=TeamLadder&Itemid={$Itemid}&menu=0";
                ?>
<p style="text-align:center;font-weight:bold;"><?php 
                if (isJoomla15()) {
开发者ID:joomux,项目名称:jTips,代码行数:67,代码来源:default.php

示例2: strtotime

</h4>
		    <?php 
        }
        if ($params->get('showround')) {
            ?>
		    <h5 style="text-align:center;">Round <?php 
            echo $jRound->round;
            ?>
</h5>
		    <?php 
        }
        if ($params->get('showclose') != '0') {
            if ($params->get('showclose') == 'static') {
                ?>
		        <p align="center"><?php 
                echo TimeDate::toDisplayDateTime($jRound->start_time, false);
                ?>
</p>
		        <?php 
            } else {
                if ($params->get('showclose') == 'count') {
                    //		        $mainframe->addCustomHeadTag("<script type='text/javascript' src='" .$mosConfig_live_site. "/components/com_jtips/js/countdown.js'></script>");
                    echo "<script type='text/javascript' src='" . $mosConfig_live_site . "/components/com_jtips/js/language.js'></script>";
                    echo "<script type='text/javascript' src='" . $mosConfig_live_site . "/components/com_jtips/js/mootools.js'></script>";
                    echo "<script type='text/javascript' src='" . $mosConfig_live_site . "/components/com_jtips/js/countdown.js'></script>";
                    //$userTime = strtotime($jRound->start_time);
                    $userTime = strtotime($this->jRound->start_time) - TimeDate::getOffset(false);
                    // let's make this consistent with the component
                    $targetTime = date('Y-m-d H:i:s', $userTime);
                    $randId = rand();
                    ?>
开发者ID:joomux,项目名称:jTips,代码行数:31,代码来源:mod_jtips_upcoming_games.php

示例3: display

    /**
     * Take data assigned in $data and display it
     */
    function display()
    {
        global $jTipsCurrentUser, $mainframe, $database, $jLang, $jTips, $mosConfig_live_site;
        $mosConfig_offset = $mainframe->getCfg('offset');
        global $Itemid;
        $useJs = false;
        if ($jTips['JsLadder'] != 'none') {
            $useJs = true;
        }
        ?>
<h2 class="contentheading jmain_heading"><?php 
        echo $this->jSeason->name;
        ?>
</h2>
<h3 align="center"><?php 
        if ($this->jRound->getPrev()) {
            ?>
 <a style="font-size: smaller;"
	href='<?php 
            echo jTipsRoute("index.php?option=com_jtips&amp;Itemid={$Itemid}&amp;view=Tips&amp;layout=locked&amp;rid=" . $this->jRound->getPrev());
            ?>
'>&laquo;
	<?php 
            echo $jLang['_COM_PREV_ROUND'];
            ?>
</a> <?php 
        }
        echo "&nbsp;" . $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round . "&nbsp;";
        if ($this->jRound->getNext()) {
            ?>
 <a style="font-size: smaller;"
	href='<?php 
            echo jTipsRoute("index.php?option=com_jtips&amp;Itemid={$Itemid}&amp;view=Tips&amp;layout=locked&amp;rid=" . $this->jRound->getNext());
            ?>
'><?php 
            echo $jLang['_COM_NEXT_ROUND'];
            ?>
&raquo;</a> <?php 
        }
        ?>
</h3>
<?php 
        if ($this->jRound->exists()) {
            $jGameParams = array('round_id' => $this->jRound->id, 'order' => array('type' => 'order', 'by' => 'position', 'direction' => 'ASC'));
            $jGame = new jGame($database);
            $jGames = forceArray($jGame->loadByParams($jGameParams));
            $tags = "class='sectiontableheader jtableheader'";
            ?>
		<table width="100%" cellspacing="0">
			<thead>
				<tr class="sectiontableheader">
					<th <?php 
            echo $tags;
            ?>
 width="50%"><?php 
            echo $jLang['_COM_ROUND_START_TIME'];
            ?>
</th>
					<?php 
            if ($jTips['ShowJSCountdown'] == 1) {
                ?>
					<th <?php 
                echo $tags;
                ?>
 width="50%"><?php 
                echo $jLang['_COM_ROUND_TIME_TO_START'];
                ?>
</th>
					<?php 
            }
            ?>
				</tr>
			</thead>
			<tbody>
				<tr class="sectiontableentry1">
					<td style="text-align: center;"><?php 
            //BUG 136 - show closed/closes depending on start time
            echo TimeDate::toDisplayDateTime($this->jRound->start_time, false);
            ?>
</td>
					<?php 
            if ($jTips['ShowJSCountdown'] == 1) {
                ?>
					<td>
					<div id='countdown' style="text-align: center;" class="highlight"><?php 
                echo $jLang['_COM_CLOSED'];
                ?>
</div>
					</td>
					<?php 
            }
            ?>
				</tr>
			</tbody>
		</table>
					<?php 
            if (jTipsGetParam($jTips, 'TeamLadderPopup', 0)) {
//.........这里部分代码省略.........
开发者ID:joomux,项目名称:jTips,代码行数:101,代码来源:locked.php

示例4: array

            $colour = "#106F00";
        } else {
            if ($status === 1) {
                $status = $jLang['_ADMIN_ROUND_STATUS_C'];
                //black - Complete
                $colour = "#000000";
            } else {
                if ($status === -1) {
                    $status = $jLang['_ADMIN_ROUND_STATUS_P'];
                    //red  - Pending Results
                    $colour = "#DF0009";
                }
            }
        }
    }
    $data[$round->id] = array(makeListLink($jLang['_ADMIN_ROUND_ROUND'] . " " . $round->round, $i++), $round->getSeasonName(), TimeDate::toDisplayDateTime($round->start_time), TimeDate::toDisplayDateTime($round->end_time), "<div style='text-align:center;color:{$colour};font-weight:bold;'>" . $status . "</div>");
}
$jSeason = new jSeason($database);
$jSeasons = forceArray($jSeason->loadByParams());
$options = array(jTipsHTML::makeOption('', $jLang['_ADMIN_USERS_SELECT_SEASON']));
foreach ($jSeasons as $season) {
    $options[] = jTipsHTML::makeOption($season->id, $season->name);
}
//$statusOptions = array(
//	jTipsHTML::makeOption('', $jLang['_ADMIN_ROUND_STATUS_SELECT']),
//	jTipsHTML::makeOption('false', $jLang['_ADMIN_ROUND_STATUS_NS']),
//	jTipsHTML::makeOption('0', $jLang['_ADMIN_ROUND_STATUS_IP']),
//	jTipsHTML::makeOption('1', $jLang['_ADMIN_ROUND_STATUS_C']),
//	jTipsHTML::makeOption('-1', $jLang['_ADMIN_ROUND_STATUS_P'])
//);
$filters = array($jLang['_ADMIN_SEASON_SELECT'] => jTipsHTML::selectList($options, 'season_id', "id='season_id' class='inputbox' onChange='this.form.submit();'", 'value', 'text', jTipsGetParam($_REQUEST, 'season_id', '')));
开发者ID:joomux,项目名称:jTips,代码行数:31,代码来源:list.php

示例5: export

 function export()
 {
     global $database;
     $query = "SELECT s.name AS 'Season Name', t.location AS 'Location', " . "t.name AS 'Team Name', t.url AS 'Website', t.wins AS 'Wins', t.draws AS 'Draws', " . "t.losses AS 'Losses', t.points_for AS 'Points Scored', t.points_against AS 'Points Conceeded', " . "t.points 'Season Points' FROM " . $this->_tbl . " t " . "JOIN #__jtips_seasons s ON t.season_id = s.id ORDER BY s.name, t.location";
     $database->setQuery($query);
     $rows = $database->loadAssocList();
     $lines = $headers = array();
     while ($row = current($rows)) {
         $line = array();
         if (empty($headers)) {
             foreach ($row as $heading => $val) {
                 array_push($headers, $heading);
             }
         }
         foreach ($row as $heading => $val) {
             if ($heading == 'Round Start' or $heading == 'Round End') {
                 //$val = getLocalDateTime($val);
                 //BUG 277 - call to undefined function
                 $val = TimeDate::toDisplayDateTime($val);
             }
             array_push($line, str_replace('"', "'", addslashes(trim($val))));
         }
         array_push($lines, '"' . implode('","', $line) . '"');
         $row = next($rows);
     }
     $body = implode("\r\n", $lines);
     $export = '"' . implode('","', $headers) . '"' . "\r\n" . $body;
     return $export;
 }
开发者ID:joomux,项目名称:jTips,代码行数:29,代码来源:jteam.class.php

示例6: export

 function export()
 {
     global $database;
     $query = "SELECT s.name AS 'Season Name', r.round AS 'Round', r.start_time AS 'Round Start', " . "r.end_time AS 'Round End', scored AS 'Processed' FROM " . $this->_tbl . " r " . "JOIN #__jtips_seasons s ON r.season_id = s.id ORDER BY s.name, r.start_time";
     $database->setQuery($query);
     $rows = $database->loadAssocList();
     $lines = $headers = array();
     while ($row = current($rows)) {
         $line = array();
         if (empty($headers)) {
             foreach ($row as $heading => $val) {
                 array_push($headers, $heading);
             }
         }
         foreach ($row as $heading => $val) {
             if (preg_match('/start/i', $heading) or preg_match('/end/i', $heading)) {
                 //$val = getLocalDate($val);
                 //BUG 277 - call to undefined function
                 $val = TimeDate::toDisplayDateTime($val);
             }
             array_push($line, str_replace('"', "'", addslashes($val)));
         }
         array_push($lines, '"' . implode('","', $line) . '"');
         $row = next($rows);
     }
     $body = implode("\r\n", $lines);
     $export = '"' . implode('","', $headers) . '"' . "\r\n" . $body;
     return $export;
 }
开发者ID:joomux,项目名称:jTips,代码行数:29,代码来源:jround.class.php

示例7: getValidationDate

 function getValidationDate()
 {
     jTipsLogger::_log('Checking date license was last validated', 'INFO');
     if (!is_array($this->licence)) {
         jTipsLogger::_log('Invalid license data!', 'ERROR');
         return -1;
     }
     /*if (strtotime($this->licence['last_validation']) > (time() - (3600 * 24 * 14))) {
     			return TimeDate::toDisplayDateTime($this->licence['last_validation']);
     		}*/
     return TimeDate::toDisplayDateTime($this->licence['last_validation']);
 }
开发者ID:joomux,项目名称:jTips,代码行数:12,代码来源:licence.php

示例8: array_shift

//Do we have an existing Season?
$id = array_shift($ids);
if (is_numeric($id)) {
    $jComment->load($id);
}
if (!$jComment->exists()) {
    mosRedirect('index2.php?option=com_jtips&task=list&module=Comments', $jLang['_ADMIN_COMMENT_LOAD_ERROR']);
}
$jTipsUser = new jTipsUser($database);
$jTipsUser->load($jComment->user_id);
$title = $jLang['_ADMIN_DASH_COMMENT_MANAGER'] . ": " . $jLang['_ADMIN_OTHER_EDIT'];
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Comments/Comments.js'></script>");
//what seasons are there
$jSeason = new jSeason($database);
$jSeasons = forceArray($jSeason->loadByParams(array()));
$jSeasonOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']));
jTipsSortArrayObjects($jSeasons, 'name', 'ASC');
foreach ($jSeasons as $season) {
    $jSeasonOptions[] = jTipsHTML::makeOption($season->id, $season->name);
}
//which season is this in?
$jRound = new jRound($database);
$jRound->load($jComment->round_id);
$jRounds = forceArray($jRound->loadByParams(array('season_id' => $jRound->season_id)));
$jRoundOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']));
jTipsSortArrayObjects($jSeasons, 'name', 'ASC');
foreach ($jRounds as $round) {
    $jRoundOptions[] = jTipsHTML::makeOption($round->id, $round->round);
}
$formData = array('basic' => array('legend' => '_ADMIN_COMM_EDIT_COMMENT', 'fields' => array('id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $jComment->id))), 'orig_round_id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'orig_round_id', 'id' => 'orig_round_id', 'value' => $jComment->round_id))), 'user_id' => array('label' => '_COM_DASH_USER', 'field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'user_id', 'id' => 'user_id', 'value' => $jComment->user_id))), 'user' => array('label' => '_COM_DASH_USER', 'field' => array('type' => 'label', 'attributes' => array('type' => 'label', 'value' => $jTipsUser->getUserField('name') . " (" . $jTipsUser->getUserField('username') . ")"))), 'season_id' => array('label' => '_ADMIN_ROUND_SEASON', 'field' => array('type' => 'select', 'attributes' => array('name' => 'season_id', 'id' => 'season_id', 'class' => 'inputbox', 'onChange' => 'getTheRounds(this);'), 'options' => $jSeasonOptions, 'selected' => $jRound->season_id)), 'round_id' => array('label' => '_ADMIN_ROUND_ROUND', 'field' => array('type' => 'select', 'attributes' => array('name' => 'round_id', 'id' => 'round_id', 'class' => 'inputbox'), 'options' => $jRoundOptions, 'selected' => $jComment->round_id)), 'comment' => array('label' => '_ADMIN_COMM_EDIT_COMMENT', 'field' => array('type' => 'text', 'attributes' => array('size' => 50, 'name' => 'comment', 'id' => 'comment', 'class' => 'inputbox', 'type' => 'text', 'value' => jTipsStripslashes(htmlentities($jComment->comment, ENT_QUOTES))))), 'updatedlabel' => array('label' => '_COM_TIPS_LASTUP', 'field' => array('type' => 'label', 'attributes' => array('type' => 'label', 'value' => TimeDate::toDisplayDateTime($jComment->updated))), 'description' => '_ADMIN_COMMENTS_UDPATED_DESCRIPTION'))));
jTipsAdminDisplay::EditView($title, $formData, 'comments');
开发者ID:joomux,项目名称:jTips,代码行数:31,代码来源:edit.php


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