本文整理汇总了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>