昨天写了段代码,用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.
看来还是多看点文档好啊。
昨天写了段代码,用Calendar.getInstance().get(Calendar.MONTH)去取月份。明明是四月,却显示了“3”,纳闷!后来在Calendar.java看到这段:
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.
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