由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - HELP! Question about Calendar
相关主题
Got it : HELP! Question about Calendarwho can help me with this dummy Question??
Calendar的日期问题junit question
compiling problem问个eclipse的问题
Re: [转载] 我的ie不能显示java applet,哪里能down plugin?大侠们帮忙,抓网页时遇到的问题,关于javascript
Hibernate strange problemThread对应的input和output问题
multiple source/output path in JBuilder9菜鸟请教个hadoop streaming job 的问题 (转载)
Re: multiple source/output path in JBuil新手问个简单问题 System.out
问几个菜问题javascript
相关话题的讨论汇总
话题: calendar话题: format话题: question话题: output话题: 2003
进入Java版参与讨论
1 (共1页)
d*r
发帖数: 238
1
Met a strange question:
I tried to set a date and output it:
Calendar c = new GregorianCalendar(2003, 12, 1); // set the calendar to
12/1/2003
System.out.println(DateFormat.getDateInstance().format(c)); // output
The output is Jan 1, 2004.
Who knows what's the problem?
I am using java 1.4.1
d*r
发帖数: 238
2
I tried another program:
Calendar c = new GregroianCalendar(2003, 12, 1); // c is Dec 1, 2003;
Date d = c.getTime();
c.setTime(d); // c changes to Jan 1, 2004;
What's wrong with my program?

【在 d*r 的大作中提到】
: Met a strange question:
: I tried to set a date and output it:
: Calendar c = new GregorianCalendar(2003, 12, 1); // set the calendar to
: 12/1/2003
: System.out.println(DateFormat.getDateInstance().format(c)); // output
: The output is Jan 1, 2004.
: Who knows what's the problem?
: I am using java 1.4.1

v**o
发帖数: 64
3
because the range of month is 0 ~ 11

【在 d*r 的大作中提到】
: Met a strange question:
: I tried to set a date and output it:
: Calendar c = new GregorianCalendar(2003, 12, 1); // set the calendar to
: 12/1/2003
: System.out.println(DateFormat.getDateInstance().format(c)); // output
: The output is Jan 1, 2004.
: Who knows what's the problem?
: I am using java 1.4.1

c*****s
发帖数: 214
4


~~~~~~~~~~~~format(c.getTime());

【在 d*r 的大作中提到】
: Met a strange question:
: I tried to set a date and output it:
: Calendar c = new GregorianCalendar(2003, 12, 1); // set the calendar to
: 12/1/2003
: System.out.println(DateFormat.getDateInstance().format(c)); // output
: The output is Jan 1, 2004.
: Who knows what's the problem?
: I am using java 1.4.1

1 (共1页)
进入Java版参与讨论
相关主题
javascriptHibernate strange problem
求Java8大牛们帮忙看看这个multithread的面试题。 (转载)multiple source/output path in JBuilder9
问个java里得到时间的问题Re: multiple source/output path in JBuil
outlook calendar integration with java mail?问几个菜问题
Got it : HELP! Question about Calendarwho can help me with this dummy Question??
Calendar的日期问题junit question
compiling problem问个eclipse的问题
Re: [转载] 我的ie不能显示java applet,哪里能down plugin?大侠们帮忙,抓网页时遇到的问题,关于javascript
相关话题的讨论汇总
话题: calendar话题: format话题: question话题: output话题: 2003