1. 程式人生 > >ThinkPHP 在頁面獲取當前時間

ThinkPHP 在頁面獲取當前時間

如圖效果自動填充當前時間:


部分程式碼:

<td colspan="3">
				<label>交貨日期(起)</label>
				<input id='startTime' type="text" class="psi-select" onclick="selectTime()" value="{:date('Y-m-d H:i:s')}">
			</td>


總結:

 thinkphp頁面獲取時間方法是 

         date('Y-m-d H:i:s') 裡面是format 的內容。

         如 :date('Y-m-d')  , date('Y-m-d', time())

    獲取unix時間戳:

time()、strtotime()