PHP³£Óú¯Êý(1)
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/02/11/1-14/
PHPÖлñµÃÈÕÆÚʱ¼äÐÅÏ¢µÄº¯Êý——Getdate
ʱ¼ä´Á:°üº¬ÁË´ÓunixмÍÔª£¨1970Äê1ÔÂ1 ÈÕÁãʱ£©µ½¸ø¶¨Ê±¼äµÄÃëÊý£¬ÊÇÒ»¸ö³¤ÕûÊý¡£
Getdateº¯Êý¾ÍÊÇÓÃÀ´»ñµÃµ±Ç°Ê±¼ä£¬»òÕßÓÃÀ´·ÖÎöʱ¼ä´ÁµÄ¾ßÌåÒâÒå¡£Óï·¨£º
Array getdate([int timestamp])
º¬Ò壺timestampÊÇÒ»¸ö°üº¬ÓÐÈÕÆÚʱ¼äÐÅÏ¢µÄÊý×飬getdateº¯Êý»áµÃµ½Ò»¸ö·µ»ØÖµ£¬Ä¬ÈÏÊǵ±Ç°Ê±¼ä£¬°üÀ¨ÈÕÆÚºÍʱ¼äµÄÍêÕûµÄÐÅÏ¢¡£
Getdateº¯Êý·µ»ØµÄÊý×é¼üÖµ
¼üÖµ
˵Ã÷
¼üÖµ
˵Ã÷
Seconds
ÃëµÄÊý×Ö±íʾ
Minutes
·ÖÖÓµÄÊý×Ö±íʾ
Hours
СʱµÄÊý×Ö±íʾ
Mday
Ô·ÝÖеĵڼ¸ÌìµÄÊý×Ö±íʾ
wday
ÐÇÆÚÖеĵڼ¸ÌìµÄÊý×Ö±íʾ
mon
Ô·ݵÄÊý×Ö±íʾ
year
ÄêµÄÊý×Ö±íʾ
yday
Ò»ÄêÖеĵڼ¸ÌìµÄÊý×Ö±íʾ
weekday
ÐÇÆÚ¼¸µÄÍêÕûÎı¾±íʾ
month
Ô·ݵÄÍêÕûÎı¾±íʾ
0
×Ô´ÓUnix¼ÍÔª¿ªÊ¼ÖÁ½ñµÄÃëÊý
ÀýÈ磺
<?php
$today = getdate(); //ÍêÕûµÄʱ¼äÐÅÏ¢
print_r($today);
echo “½ñÌìÊǽñÄêµÄµÚ”.$today['yday'].”Ìì”;
?>
½á¹û£º
Array ( [seconds] => 25 [minutes] => 49 [hours] => 5 [mday] => 11 [wday] => 4 [mon] => 2 [year] => 2010 [yday] => 41 [weekday] => Thursday [month] => February [0] => 1265867365 ) ½ñÌìÊǽñÄêµÄµÚ41Ìì
PHPÖлñµÃµ±Ç°Ê±¼äµÄº¯Êý——gettimeofday
PhpÖÐÒý½øÁËgettimeofdayº¯Êý£¬ÓÃÓÚ½â¾ögetdateº¯ÊýÖ»Äܾ«È·µ½ÃëµÄÒź¶£¬gettimeofdayº¯Êý¿ÉÒÔ¾«È·µ½Î¢Ãî¡£Óï·¨£º
¡¡Array gettimeofday(void)
Gettimeofdayº¯Êý·µ»ØµÄÊý×飬°üº¬ÓÐÈçÏÂÊý¾Ý£º
Sec£º ×Ô´ÓUnix¼ÍÔª¿ªÊ¼ÖÁ½ñµÄÃëÊý£»
Usec£ºÎ¢ÃîÊý£»
Minuteswest£º¸ñÁÖÍþÖÎÏòÎ÷µÄ·ÖÖÓÊý£»
Dsttime£ºÏÄÁîʱÐÞÕýµÄÀàÐÍ¡£Èç¹ûÊÇÏÄÁîʱÔòΪ1£¬·ñÔòΪ0.
ÀýÈ磺
<?php
$today = getdate();
echo $today[0].”\n”; //Êä³öÃëÊý
$today = gettimeofday();
print_r($today); //Êä³ö½ñÌìµÄÏêϸÐÅÏ¢
?>
½á¹û£º
1265869037
Array ( [sec] => 1265869037 [usec] => 515628 [minuteswest] => 0 [dsttime] => 0 )
PHPÖÐÈÕÆÚÑéÖ¤º¯Êý——checkdate
Checkdateº¯ÊýÓÃÀ´ÑéÖ¤Ò»¸öÈÕÆÚÊÇ·ñÓÐЧ¡£Óï·¨£º
¡¡Bool checkdate(int month,int day,int year)
Èç
Ïà¹ØÎĵµ£º
ÔÚÕ⼸ÌìµÄ¹¤×÷¹ý³ÌÖУ¬ÐèҪʵÏÖPHPÔÚ·þÎñÆ÷¶ËÄÜÓëÆäËû³ÌÐòͨÐÅ¡£ºÍÀϺÎÁ©ÈËÑо¿ÁË°ëÌ죬ÖÕÓÚ´óÖÂŪ³öÁËÒ»¸öÓÃWINDOWSµÄÃüÃû¹ÜµÀͨÐŵķ½·¨¡£
Óм¸µãÐèҪעÒâµÄ£º
PHP·þÎñÆ÷¶ËÎÒÃÇÿ´Î¶¼ÊÇÖØйҽÓÃüÃû¹ÜµÀ¡££¨ÕâÑùд£¬PHP¶Ë´úÂëÁ¿¼«ÆäÉÙ£¬¶øÇÒÒ²ºÜ·½±ã¡££©
ÄÇôÎÒÃÇÓÃC/C++дµÄÃüÃû¹ÜµÀ·þÎñÆ÷ÔòÐèҪÿ´ÎͨÐŶ¼´´½¨Ò»´Î¹ ......
Äêµ×ÁË£¬±¾À´´òËãÌáÇ°Ò»ÖÜÇë¼Ù»Ø¼ÒµÄ£¬Áìµ¼Ò²ÅúÁË£¬µ«ÊÇÁÙʱÓÖÓÐÁËÈÎÎñ£¬ÐèÒªÔÚÄêÇ°´îÒ»¸öÑÝʾϵͳ£¬ÓÚÊDZ»¿ÛÏÂÁË¡£¡£
ÐèÒª×öÒ»¸ö¶à»úͨÐŵÄϵͳ£¬ÎÒÕâ±ßµÄÈÎÎñ´ó¸Å¾ÍÊÇÐèÒª¹ÜÀíÔ±Óû§ÄܶÔÊý¾Ý¿âÄÚÈݽøÐб༣¬²¢ÇÒͨ¹ý·þÎñÆ÷ÖÐת³ÌÐòÓë¿Í»§Óû§³ÌÐòͨÐÅ¡£×ܹ²Ò²Ã»¶àÉÙ¹¤×÷Á¿£¬ºÍ¼¸¸ö¿ª·¢ÈËÔ±¼òµ¥µÄÉÌÌÖÁËһϣ¬È·¶¨ÁË´óÌå ......
±¾ÈËÕýÔÚ¿ª·¢Ò»Ì×¹ÉƱϵͳ£¬ÔÚÊý¾ÝºÍËã·¨·½ÃæÒѾûÓÐÎÊÌ⣬ÏÖÑ°ÕÒÒ»ÃûÊìÁ·µÄPHP Web¿ª·¢ºÏ×÷ÈËÔ±£¬ÒªÇóÈçÏ£º
1.ÊìϤPHP+MySQL¿ª·¢£»
2.Äܹ»Éè¼ÆÖÆ×÷ÃÀ¹ÛµÄ½çÃ棻
3.Äܹ»ÔÚϵͳÖÐÊìϤʹÓÃAjaxЧ¹û£»
4.ÊìϤÍøÉÏÖ§¸¶£¨Ö§¸¶±¦¡¢²Æ¸»Í¨»òÆäËû£©£»
5.ÊìϤÈËÈËÍø¡¢Ð£ÄÚ¡¢ÂþÓѵÈSNS¿ª·Åƽ̨¿ª·¢ÕßÓÅÏÈ£»
6.ÒªÇóÈËÔÚÉϺ££¬Ó ......
php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charse ......