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
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
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
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
Android time and date Processing DateUtils, SystemClock, and DateFormat
It always takes some processing of time and date, such as the time interval of a program and the formatting of date and time... note
Common java time and date class:
Java.
1. Date class Common method: Long gettime (): returns the millisecond value since 00:00:00, January 1, January 1, 1970, and converts a date object to a millisecond value. 2. dateformat class The date format class is an abstract class of the
DateThe class Date represents a specific instantaneous, accurate to milliseconds.Millisecond concept: 1000 milliseconds = 1 seconds0 points in milliseconds:System.currenttimemillis () return value long type parameterThe millisecond value used to get
The role of SimpleDateFormat1: Convert a Date object to a string of a specific format method2: Convert a string to a Date object in a specific format parse methodPackage Day25;import Java.text.parseexception;import Java.text.simpledateformat;import
Java. util. Date: indicates a specific moment, accurate to milliseconds. Before jdk1.1, the date is interpreted as the year, month, day, hour, minute, and second values, but its functions are not easy to internationalize. Therefore, from jdk1.1, use
The calendar, date, and dateformat of the Java language constitute a basic but important part of the java standard. Date is a key part of business logic computing. All developers should be able to calculate the future date, customize the display
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.