今天第一次知道UTC时间竟然还有夏令时,这不是添乱嘛。
原来写的代码转换时区时都是用timestamp +3600*8 。。
function conventDateTime_UTCtoChina($strDatetime){
date_default_timezone_set(’Europe/London’);
$t = strtotime($strDateTime);
date_default_timezone_set(’Asia/Shanghai’);
return date(’Y-m-d H:i:s’,$t );
}
下面这段代码在fireFox和IE中的结果是不同的
function trim (str)
{
return str.replace(/ */g, '');
}
function getTextContent (el)
{
if (el.textContent) return el.textContent;
if (el.innerText) return el.innerText;
if (el.innerHTML) return
el.innerHTML.replace(/( )|( )|( )/g, ' ');
}
here is the text 0.123
tag:javascript 正则
大体上就是列表页多了上面的文章摘要,还是挺实用的东西
以后可以在自己手机上用iPhone版的GReader了,呵呵
Google真小气,直接所有手机上都一样改进不就好了。小气
想获得 div的name属性值请使用 div.getAttribute(’name’)
完毕
需求有时就是这么的变态
情况:通过CronTab定时并发执行的一系列php程序 ,我想检测 其中的某个程序的效率。
分析:
开始的时候想通过xdebug.profiler_enable = 1并且传入GET/POST 。
但发现SHELL下PHP并不提供产生GET/POST的机制。
通过PHP -h发现可以在调用的时候使用“ -d foo[=bar] Define INI entry foo with value ‘bar’”方式改变INI设置,
于是 一切变得简单了:php -d xdebug.profiler_enable=1 ./i.php
搞定。
Function、Self、File、Called From 都很容易明白
唯独这个Cum不知道什么意思 。。
今天终于去搜索了一下XDebug的网站,发现了这个 。
原来Self是代表此Funcion自己花费的 时间,不包含此Function调用的其他Function。
而Cum则是 此Funcion整体花费的 时间,包含此Function调用的其他Function。