返回一個根據(jù)指定格式進行格式化的新的 DateTime 對象:
<?php
$date=date_create_from_format("j-M-Y","25-Sep-2016")
;
?>
date_create_from_format() 函數(shù)返回根據(jù)指定格式進行格式化的新的 DateTime 對象。
date_create_from_format(format,time,timezone);
參數(shù) | 描述 |
---|---|
format |
必需。規(guī)定要使用的格式。format 參數(shù)字符串可以使用下列的字符:
|
time | 必需。規(guī)定日期/時間字符串。NULL 指示當(dāng)前的日期/時間。 |
timezone | 可選。規(guī)定 time 的時區(qū)。默認(rèn)為當(dāng)前時區(qū)。 |
返回值: | 如果成功則返回 DateTime 對象,如果失敗則返回 FALSE。 |
---|---|
PHP 版本: | 5.3+ |
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答??! 點擊進入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號