PHP 快速導覽 - 核心延伸函數 日期、時間相關 idate()

內建函數 (function) idate() 回傳設定時間格式的數字

函數說明
int idate(string $format [, int $timestamp = time()])$format 為時間格式字串


參數 (parameter) 為字串,須注意回傳的是整數。


舉例如下
<?php
date_default_timezone_set('Asia/Taipei');
echo idate('Y') . "\n";
echo idate('m') . "\n";
echo idate('d') . "\n";

/* 《程式語言教學誌》的範例程式
    http://pydoing.blogspot.com/
    檔名:datetime36.php
    功能:示範 PHP 程式 
    作者:張凱慶
    時間:西元 2013 年 2 月 */
?>


執行結果如下



中英文術語對照
函數function
字串string
參數parameter


您可以繼續參考
日期、時間相關的類別與函數


相關目錄
回 PHP 快速導覽
回 PHP 教材
回首頁


參考資料
http://www.php.net/manual/en/function.idate.php

沒有留言: