默认为UTC

----- 002-time.php -----

 <!DOCTYPE html>
 <html>
 <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <title>一个PHP网页</title>
 </head>
 <body>
 <?php echo date("Y-m-d H-i-s", time()) ?>
 </body>
 </html>

显示警告

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in D:\a\php\root\002-time.php on line 8
2014-05-16 07-49-01

屏蔽警告

 <!DOCTYPE html>
 <html>
 <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <title>一个PHP网页</title>
 </head>
 <body>
 <?php @echo date("Y-m-d H-i-s", time()) ?>
 </body>
 </html>

显示错误:

Parse error: syntax error, unexpected 'echo' (T_ECHO) in D:\a\php\root\002-time.php on line 8

继续改 原来@只作用于表达式

 <!DOCTYPE html>
 <html>
 <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <title>一个PHP网页</title>
 </head>
 <body>
 <?php echo @$cur_time = date("Y-m-d H-i-s", time()); ?>
 </body>
 </html>

换东八区

echo $cur_time = @date("Y-m-d H-i-s", time()+8*3600);

最新文章

  1. 关于java中MessageFormat.format中单引号问题
  2. java提高篇(十七)-----异常(二)
  3. Android开发配置,消除SDK更新时的“https://dl-ssl.google.com refused”异常
  4. 使用kendoui实现日期除去工作日
  5. Ubuntu Server14.04 32位安装odoo8.0简单方法
  6. PDF出力相关资料
  7. CSS3做小三角形
  8. 节点插入--对比jQuery和JavaScript方法(一)
  9. 浅析Linux操作系统工作的基础
  10. Mac 删除Openfire
  11. 如何下载和编译Android4.0内核源代码goldfish(图像)
  12. Linux中的定时任务at、crontab
  13. PS图片去色
  14. SDL 在指定窗口中绘图
  15. 谈一谈泛型(Generic)
  16. Android4.2.2源码目录结构分析
  17. Python进阶:设计模式之迭代器模式
  18. vmware P2V迁移域内windows服务器脱域问题
  19. csv文件读写处理
  20. (未完结)“文远知行杯”GDET第十四届竞赛(网络赛共10题,仅整理出6题)

热门文章

  1. DEM数据及其他数据下载
  2. 阿里云对象存储oss上传文件夹
  3. 在Win环境下配置java的环境进行开发步骤
  4. imooc movie
  5. Poj2296
  6. nfs 客户端挂住
  7. ubuntu 安装CUDA 8.0
  8. DevExpress中获取GridControl排序之后的List
  9. AngularJS指令封装高德地图组件
  10. mongoose入门