Archive for 四月, 2011
Linux下自行颁发SSL证书
- openssl genrsa -des3 -out test.com.key 1024
- openssl req -new -key test.com.key -out test.com.csr
- openssl rsa -in test.com.key -out test.com_nopass.key
- openssl x509 -req -days 365 -in test.com.csr -signkey test.com.key -out test.com.crt
Nginx的配置:
- server {
- server_name www.test.com;
- listen 443;
- index index.html index.htm index.php;
- root /data/wwwroot/www.test.com;
- ssl on;
- ssl_certificate test.com.crt;
- ssl_certificate_key test.com_nopass.key;
- ......
- }
php的strtotime在处理am/pm时的一个BUG
今天在处理一个采集数据时发现采集到的时间是空的,到源网站看了一下,发现是有时间的。联想到之前一个am/pm的问题,然后就有了如下测试。
测试代码:
- $date = date('Y-m-d');
- $array = array('00:00am','00:00pm','00:01am','00:01pm', '01:01am','01:01pm','12:00am','12:00pm','12:01am','12:01pm');
- foreach ($array as $time) {
- echo $date . ' ' . $time.'<br />';
- echo strtotime($date . ' ' . $time).'<br />';
- echo date('Y-m-d H:i:s', strtotime($date . ' ' . $time)).'<br /><hr />';
- }
大家可以先自己想想预期的答案是什么,再往下看:
Read the rest of this entry »
近期评论