网志人生

April 12, 2006

Java的月份 [Java之旅] — 不想放弃 @ 12:48 am

  昨天写了段代码,用Calendar.getInstance().get(Calendar.MONTH)去取月份。明明是四月,却显示了“3”,纳闷!后来在Calendar.java看到这段:

        The first month of the year is <code>JANUARY</code> which is 0; the last depends on the number of months in a year.

  看来还是多看点文档好啊。

Comments »

The URI to TrackBack this entry is: http://bloglife.blogsome.com/2006/04/12/java_month/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


Get free blog up and running in minutes with Blogsome
Theme designed by Dave Shea