DateFormat1. DateFormat IntroductionThe role of DateFormat is to format and parse the date/time. In fact, it is the date formatting tool that helps us format date and then converts date into the string string we want to useHowever, the DateFormat
This chapter mainly introduces DateFormat.
DateFormat Introduction
The role of DateFormat is to format and parse the date/time. In fact, it is the date formatting tool that helps us format date and then converts date into the string string we want
Javaweb Internationalization
DateFormat: A tool class that formats dates and is itself an abstract class;
NumberFormat: the character class that formats numbers into numeric strings, or currency strings;
Messageformat: You can format pattern
DateFormat: A tool class that formats a date, itself an abstract class;NumberFormat: A character class that formats numeric to numeric strings, or currency strings;Messageformat: Can format pattern string, pattern string: string with placeholder:
Learning GoalsMastering the use of the date classyou can use the Calendar class to get a full dateMastering Date-formatted operationsformat conversion operation for dates that can be used with SimpleDateFormatto write a date-Acquired action
1:datedemo1 class
* * Time to get the
system
/public class DateDemo1 {public
static void Main (String args[]) {
System.out.println (System.currenttimemillis ());
}
Output as: 1311060393171
The results show the number of milliseconds
First, DateFormatUse Getdateinstance to get the standard date format for that country/region. Additional static factory methods are also available. Use Gettimeinstance to get the time format for that country/region. Use Getdatetimeinstance to get
PackageCommon classes. Date;ImportJava.text.DateFormat;Importjava.text.ParseException;ImportJava.text.SimpleDateFormat;Importjava.util.Date;/**The month is represented by an integer of 0-11, 0 is January, and 11 is the December * Date Object--The
1. DateFormat class overview:DateFormat is an abstract class of date/time formatting subclasses that formats and resolves dates or times in a language-independent manner. is an abstract class, so use its subclasses SimpleDateFormat2.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.