javascript ת»»ÎªUNIXʱ¼ä´Á£¬PHP¿ÉÓÃ
//ת»»ÎªUNIXʱ¼ä´Á
function strtotimestamp(datestr)
{
var new_str = datestr.replace(/:/g,"-");
new_str = new_str.replace(/ /g,"-");
var arr = new_str.split("-");
var datum = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],arr[3]-8,arr[4],arr[5]));
return (datum.getTime()/1000); //ΪPHPËùÓÃ
}
//UNIXʱ¼ä´Áת»»Îª×Ö·û´®
function timestamptostr(timestamp) {
d = new Date(timestamp.getTime());
var jstimestamp = (d.getFullYear())+"-"+(d.getMonth()+1)+"-"+(d.getDate())+" "+(d.getHours())+":"+(d.getMinutes())+":"+(d.getSeconds());
return jstimestamp;
}
javascript timestamp ºÍPHP ʱ¼ä´Á ²î 8¸öСʱ
strtotimestamp("2010-01-01 08:00:00"); //PHPÊä³ö 2010-01-01 00:00:00
strtotimestamp("2010-01-11 23:59:59")+(8*60*60); //PHPÊä³ö 2010-01-11 23:59:59
Ïà¹ØÎĵµ£º
1.È¡µÃµ±Ç°ÄÚ´æÊ¹ÓôóС£ºmemory_get_usage()
2.¼ÆËãÖ´ÐÐʱ¼ä£ºmicrotime(true)
3.ÉèÖÃscriptÖ´ÐÐʱ¼äÏÞÖÆset_time_limit
4.ÉèÖÃÄÚ´æÏÞÖÆini_set("memory_limit","256M");
3.´ÓÔ¶³ÌÏÂÔØÎļþµÄÁ½¸ö·½·¨£º
$contents=file_get_contents("http://www.govtrack.us/data/us/gis/zip4dist-prefix.t ......
×î½ü¹¤×÷ÖÐÓöµ½Ò»¸öÍ·ÌÛµÄÎÊÌâ:phpÖе÷ÓÃÒ»¸ö´æ´¢¹ý³Ì(Òª¸´ÖÆN¶àÊý¾ÝµÄ.),ÓÉÓڴ˹ý³ÌÖ´ÐÐʱ¼äºÜ³¤.µ¼ÖÂphp×ÜÊdz¬Ê±´íÎó:
Service Temporarily Unavailable
The
server is temporarily unable to service your request due to maintenance downtime
or capacity problems
.
Please
try
again
later
.
ÎÊÌ ......
<!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; charset=gb2312" />
<title> JavaScript: xm ......
ÓÃphp»ñÈ¡±¾ÖÜ,ÉÏÖÜ,±¾ÔÂ,ÉÏÔÂ,±¾¼¾¶ÈÈͮ򵀫úÂë,Ö÷ÒªÓõ½date,strtotimeºÍmktimeº¯Êý.
echo date("Ymd",strtotime("now")), "<br />";
echo date("Ymd",strtotime("-1 week Monday")), "<br />";
echo date("Ymd",strtotime("-1 week Sunday")), "<br />";
echo date("Ymd",strtotime("+0 week ......