手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2010年02月9日的文章

Patch1 for NetBeans IDE 6.8 Now Available

这次更新对PHP来说只有两个更新,但这两个更新都很重要,一个是自动缩进的问题,还有一个是interface的问题。
interface我不知道是什么问题,因为没仔细注意过,自动缩进也只是偶尔出现,有时候代码没有写全时,敲回车到新行时,却不由自主的缩进了。。

看看官方的说明先:
The NetBeans team has released a new patch, which is an update to the NetBeans IDE 6.8.

The patch includes bug fixes in modules for C/C++, EJB and EAR, GUI Builder, IDE Platform, Java, Java Debugger, JavaFX SDK, Java Persistence, Java Web Applications, JSF, Local History, PHP, RCP Platform, RESTful Web Services, and Team.

To obtain the fixes, the NetBeans IDE must be installed and running. You can download the fixes through the IDE's Plugin Manager.

关于PHP的更新只有两条:

5-Feb-2010 PHP - Provides tools and support for PHP development. 1.11.2 178542 Wrong indentation when using new line for braces placement.
05-Feb-2010 PHP - Provides tools and support for PHP development. 1.11.2 178103 [68cat] Wrong code genaration from interface

Tags: netbeans

PHP 中如何处理时区

小记录,一般情况而言,默认安装好的lamp中,时间都是标准GMT时间,基本上,我们中国时间都应该是+8才对,但很多人往往不设置。

因此,为了时间正确,建议你还是设置一下默认时区,否则出现这8小时的误差也很郁闷的。

那么如何知道自己的时区是否正确呢?在不知道一些系统函数的情况下,直接输出 date('Y-m-d H:i:s', now()) ,就可以了解了。。

那么,我在知道这样的问题后,怎么能够知道当前设定的时区是哪里呢?这时可以通过:date_default_timezone_get()函数来获取,理所当然,设置时区就是date_default_timezone_set()了。

手册上也说明,在PHP 5.1之后,如果时区不正确,那每次在调用Date或者time函数时,都会有一个warning 或者 notice出现:

XML/HTML代码
  1. Note: Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_STRICT message if using the system settings or the TZ environment variable.   

当然,如果你觉得这样设置很麻烦,你可以更改php.ini文件中的 ;date.timezone = ,添加自己需要的时区,例如 date.timezone = Asia/Chongqing,然后重启服务器就可以了。PHP支持的 timezone 的字符串在手册中能够查到。

手册中的:Appendix J. List of Supported Timezones,可以查看所有支持的时区。

Note: The latest version of the timezone database can be installed via PECL's timezonedb. For Windows users, a pre-compiled DLL can be downloaded from the PECL4Win site: php_timezonedb.dll.

Tags: 时区