-
int getActualMaximum(Calender.DATE); // Returns the field value of the field used for the most
-
Day_of_Year; // Today is the first day of the year
-
int get(int field); // Returns the value of the specified calendar field field of
-
Date getTime(); // Get a Date object in the object calender
-
void set(int field,int value); // the value of the specified field will be set to the value specified // Example: cal.set(Calender.YEAR,2008); // set the year 2008 void set(int year,int month,int Date);
-
abstract void add(int field,int mount); // the specified field, increase or decrease the amount of time specified
-
void roll(int field,int amount); // This is the same function and add methods, allowed to exceed the maximum value, but without any carry, but standing around
-
// java.text.DateFormat is the date / time format abstract class, we can complete the conversion between text and date
-
Formatted date into the date string, parses the date, the date string is converted to
-
Since the object is to create abstract class, can not directly create objects, but to create a subclass objects java.text.SimpleDateFormat;
-
// constructor subclass SimpleDateFormat (String pattern); // using the specified format string pattern creation date format object
-
// example DateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
Formatting rules:
-
y Year
-
M May
-
d day
-
When H
-
m min
-
s seconds
-
-
Date parse(String source) // convert string objects time DATE
-
// ParseException the Exception, when the source string analysis conditions is not satisfied, the custom date format is not satisfied; and this exception is a compile-time, check exception
Java study notes nine - date
Guess you like
Origin www.cnblogs.com/sunTyphonn/p/11768347.html
Recommended
Ranking