當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XDateTime::valueOfNow方法代碼示例

本文整理匯總了PHP中XDateTime::valueOfNow方法的典型用法代碼示例。如果您正苦於以下問題:PHP XDateTime::valueOfNow方法的具體用法?PHP XDateTime::valueOfNow怎麽用?PHP XDateTime::valueOfNow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XDateTime的用法示例。


在下文中一共展示了XDateTime::valueOfNow方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

<div class="center_r_bar">
<div class="r_bar_tit"><a href="http://www.<?=URL_PREFIX?>haodf.com/tingzhen.htm" target="_blank" class="blue2">更多>></a></div>
<div class="r_bar_con" id="announcelist" style="height: 82px; overflow: hidden;">
<ul class="r_bar_list">
<?php foreach ($hospitalAnnounceList as $hospitalAnnounce) {?>
	<li><span class="f_rt"><?=$hospitalAnnounce->utime->toStringByFormat('d日H時更新')?></span>
	<a class="blue" href="http://www.<?=URL_PREFIX?>haodf.com/hospital/<?=Codec::getInstance()->encodeId($hospitalAnnounce->hospital->id)?>/announce.htm" target="_blank">
	<?=$hospitalAnnounce->hospital->commonName?></a></li>
<?php } ?>
</ul>
</div>
</div>
<!--出停診信息-->
<?php
//2012國慶門診安排
if(XDateTime::valueOfNow()->before(XDateTime::valueOf('2012-10-08 00:00:00')))
{
    ?>
    <div class="mb10 tc" style="height: 35px; width: 300px; background: url(http://i1.hdfimg.com/zhuanti/ztimg/2012_guoqing.jpg?2012092001); line-height: 35px;">
    <a href="http://www.<?=URL_PREFIX?>haodf.com/zhuanti/2012nianzhongqiuguoqingqijianquanguogedayiyuanmenz.htm" target="_blank" class="red fb">2012年中秋國慶期間全國各大醫院門診安排</a>
    </div>
    <?php
}
?>
<div class="center_r_bar">
<a href="http://www.<?=URL_PREFIX?>haodf.com/thesis/showtaglist?searchType=tagId&searchParam=4" target="_blank" style="cursor:hand"><div class="r_bar_tit2"></div></a>
<!--首頁右側廣告2-->
<?php echo Place::getPlaceContent('ads', 'disease_ads_one', 'ad_index_four'); ?>
<!--首頁右側廣告2-->
<!--新熱點-->
<?=CmsTplClient::getInstance()->get_tpl_html('120781506')?>
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:31,代碼來源:index_content_top_sidebar.php

示例2: if

<script type="text/javascript">
	var urlprefix = '<?=URL_PREFIX?>';
</script>
<script type="text/javascript"	src="http://i1.hdfimg.com/js/jquery-1.4.2.min.js?20101126"></script>
<script type="text/javascript" src="http://i1.hdfimg.com/homepage/js/ks-core-min.js?20101126"></script>
<script type="text/javascript" src="http://i1.hdfimg.com/bigpipe/www/js/function.js?201409171900"></script>
<script type="text/javascript" src="http://i1.hdfimg.com/my/js/jquery.framework.min.js?20140807"></script>
<script type="text/javascript" src="http://i1.hdfimg.com/js/login_bar.e5470742.js"></script>
<script type="text/javascript" src="http://i1.hdfimg.com/js/jquery-ui-1.8/js/jquery-ui-1.8.custom.min.js"></script>            
<script type="text/javascript" src="http://i1.hdfimg.com/js/jquery-ui-1.8/development-bundle/ui/jquery.ui.dialog.js"></script> 
<script type="text/javascript" src="http://i1.hdfimg.com/js/fancybox/fancybox.js?1358357449"></script>
<script type="text/javascript" src="http://i1.hdfimg.com/space/present/present.js?2012072501"></script>
<script type="text/javascript" src="http://i1.hdfimg.com/searchfront/js/autocomplete.js?20140619"></script>
<?php if (XDateTime::valueOfNow()->before(XDateTime::valueOf('2013-02-25 00:00:00')))
{
?>
<!-- start happy new year -->
<style>
	body{ background: url(http://i1.hdfimg.com/www/images/hny01.jpg) repeat-x left 30px;}
	#hny{ background: url(http://i1.hdfimg.com/www/images/hny02.jpg) no-repeat center top;}
	#index_page{ width:960px; overflow: hidden;}
	.page_jj{ padding:0px;}
</style>


<script>
$("#index_page").wrap('<div id="hny"></div>');
</script>
<!-- end happy new year -->
<?php
}
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:31,代碼來源:index_frame_end.php


注:本文中的XDateTime::valueOfNow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。