国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > PHP > 正文

PHP使用GETDATE獲取當(dāng)前日期時(shí)間作為一個(gè)關(guān)聯(lián)數(shù)組的方法

2024-05-04 23:32:55
字體:
供稿:網(wǎng)友

這篇文章主要介紹了PHP使用GETDATE獲取當(dāng)前日期時(shí)間作為一個(gè)關(guān)聯(lián)數(shù)組的方法,實(shí)例分析了php中GETDATE函數(shù)使用技巧,需要的朋友可以參考下

本文實(shí)例講述了PHP使用GETDATE獲取當(dāng)前日期時(shí)間作為一個(gè)關(guān)聯(lián)數(shù)組的方法。分享給大家供大家參考。具體分析如下:

PHP GETDATE函數(shù)是用來獲得當(dāng)前的日期和時(shí)間,從操作系統(tǒng)或一個(gè)關(guān)聯(lián)數(shù)組轉(zhuǎn)換成UNIX風(fēng)格的日期整數(shù)。

語法格式如下

 

 
  1. array getdate (); 
  2. array getdate (integer $Time); 

參數(shù)如下:

Arguments

$Time

The number of seconds since midnight before January 1, 1970. (UNIX style.)

Default

The default is the current date and time from the operating system.)

The return value is an associative array containing:

monThe month of the year as a number (1..12)

mdayThe day of the month (1..31)

yearThe year (4 digits)

hoursThe hour of the day (0..23)

minutesThe minutes of the hour (0..59)

secondsThe seconds of the minute (0..59)

monthThe month of the year as a word (January..December)

ydayThe day of the year (0..365)

wdayThe day of the week as a number (0..6)

weekdayThe day of the week as a word (Sunday..Saturday)

0Seconds since midnight before January 1, 1970

下面是一個(gè)使用范例:

 

 
  1. <?php 
  2. $Now = getdate(); 
  3. foreach ($Now as $Key => $Value) { 
  4. echo "$Key => $Value/n"
  5. ?> 

輸出結(jié)果如下:

 

 
  1. seconds => 59 
  2. minutes => 14 
  3. hours => 7 
  4. mday => 26 
  5. wday => 6 
  6. mon => 12 
  7. year => 2009 
  8. yday => 359 
  9. weekday => Saturday 
  10. month => December 
  11. 0 => 1261811699 

希望本文所述對大家的php程序設(shè)計(jì)有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 芦溪县| 岑溪市| 偏关县| 辉县市| 军事| 普洱| 平南县| 蒙城县| 定西市| 丰城市| 双峰县| 温泉县| 招远市| 旬邑县| 怀来县| 长治县| 襄垣县| 类乌齐县| 河曲县| 马尔康县| 三亚市| 蒙阴县| 曲阳县| 西青区| 磴口县| 遂平县| 静乐县| 福建省| 寿光市| 凤冈县| 容城县| 密云县| 蒙城县| 仙居县| 那坡县| 清远市| 武平县| 武义县| 内江市| 伊春市| 琼海市|