2013-02-14 35 views
0

我有一种方法我必须使用来设置日期对象,在下面示出:日期对象设定

  • 方法名(日期d)

现在这需要很长的构造似乎小技巧来处理, 所以我想听听您的意见,如果有人在那里知道如何使它功能, 将同时指定年,月&也一天时间。????

回答

1

您可以改为使用calendar。它有日期和时间。

Calendar field access 

Field     Explanation 
Calendar.YEAR   Identifies the year 
Calendar.MONTH   Identifies the month 
Calendar.DAY_OF_MONTH Identifies the day 
Calendar.HOUR   Identifies the hour 
Calendar.MINUTE   Identifies the minute 
Calendar.SECOND   Identifies the second