本文整理匯總了PHP中JDate::date_format方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDate::date_format方法的具體用法?PHP JDate::date_format怎麽用?PHP JDate::date_format使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JDate
的用法示例。
在下文中一共展示了JDate::date_format方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dates_format
function dates_format($sdate, $edate)
{
$syear = JDate::year($sdate);
$eyear = JDate::year($edate);
$ret = JDate::date_format($sdate, 'Y m月d日') . " ~ ";
if ($syear == $eyear) {
$ret .= JDate::date_format($edate, 'm月d日');
} else {
$ret .= JDate::date_format($edate, 'Y m月d日');
}
return $ret;
}
示例2: textNewsStyleS
function textNewsStyleS($d = null)
{
if ($d != null) {
?>
<a href="news_cnt.php?id=<?php
echo $d->id;
?>
"></a>
<div class="metro-art">
<hgroup>
<h1 class="news-title"><?php
echo $d->title;
?>
</h1>
<p class="news-time"><?php
echo JDate::date_format($d->date, 'm月d日 Y');
?>
</p>
</hgroup>
<p class="news-shrink_text">
<?php
echo JWStdio::strip_truncate($d->content, 154);
?>
</p>
</div>
<?php
} else {
?>
<a href="Javascript:void(0);"></a>
<div class="metro-art">
<hgroup>
<h1 class="news-title"></h1>
<p class="news-time"></p>
</hgroup>
<p class="news-shrink_text"></p>
</div>
<?php
}
}
示例3:
?>
banner-news.jpg')">
</section>
<main class="">
<header class="cnt_title">
<div class="wrapper small">
<h2 class="news-title">
<?php
echo $news->data['title'];
?>
</h2>
<p class="news-time">
<?php
echo JDate::date_format($news->data['date'], 'm月d日 Y');
?>
</p>
</div>
</header>
<section class="fullbg row2">
<div class="bg"></div>
<div class="wrapper">
<div class="cnt cf">
<article class="editorDF">
<?php
echo $news->data['content'];
?>
</article>
<!--<img src="<?php
?>
示例4: textNewsStyle1
function textNewsStyle1($d = null)
{
if ($d != null) {
?>
<a href="news_cnt.php?id=<?php
echo $d->id;
?>
"></a>
<div class="news-pic pic left">
<img src="<?php
echo $d->icon;
?>
" />
</div>
<div class="metro-art right">
<hgroup>
<h1 class="news-title"><?php
echo $d->title;
?>
</h1>
<p class="news-time"><?php
echo JDate::date_format($d->date, 'm月d日 Y');
?>
</p>
</hgroup>
<p class="news-shrink_text">
<?php
echo JWStdio::strip_truncate($d->content, 154);
?>
</p>
</div>
<?php
} else {
?>
<a href="Javascript:void(0);"></a>
<div class="news-pic pic left">
<img src="dist/images/news-cover.jpg" />
</div>
<div class="metro-art right">
<hgroup>
<h1 class="news-title"></h1>
<p class="news-time"></p>
</hgroup>
<p class="news-shrink_text">
</p>
</div>
<?php
}
}
示例5: foreach
<ul class="art_search-list">
<?php
foreach ($pager->rsData as $d) {
?>
<li class="art_search-item cf">
<div class="news-pic pic left">
<img src="upload/news/news_051701.jpg" alt="">
</div>
<div class="news-intro left">
<hgroup class="cnt_title">
<h1 class="news-title"><?php
echo $d->title;
?>
?</h1>
<p class="news-time"><?php
echo JDate::date_format($d->date, 'm月d日 Y');
?>
</p>
</hgroup>
<p class="news-shrink_text">
<?php
echo JWStdio::strip_truncate($d->content, 154);
?>
</p>
<div class="news-link">
<a href="news_cnt.php?id=<?php
echo $d->id;
?>
" class="btn btn-black btn-more">繼續閱讀</a>
</div>
</div>