[英]Displaying the current Year inside my SharePoint master page
我正在SharePoint 2013團隊網站上工作。 在seatle.master頁面中,我定義了以下內容:
<div id="customFooter" class="noindex">© .. Group 2013</div>
但是我不確定是否有一種方法可以從我的母版頁訪問Date對象,然后顯示當前年份而不是手動鍵入年份。 這將需要在一年后進行更新。 謝謝
試試這個
<div id="customFooter" class="noindex">
© .. Group <%=DateTime.Now.Year.ToString() %>
</div>
嘗試這個:
<div id="customFooter" class="noindex"> © .. Group <script type="text/javascript">document.write(new Date().getFullYear());</script> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.