Java.SimpleDateFormat.Date.getTime.setTime.Format

import java.text.SimpleDateFormat; //SimpleDateFormat类所在的包 import java.util.Date; //Date所在的包 Date a=new Date(); SimpleDateFormat b=new SimpleDateFormat(); long c; a=b.parse("00:00:00"); //SimpleDateFormat.parse(String ) Parses text from a string to produce a Date. c=a.getTime(); //Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object a.setTime(c); //void setTime(long time) --Sets this Date object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT. String strTime=b.format(c); // Formats the given Date into a date/time string and appends the result to the given StringBuffer.

你可能感兴趣的:(c,Date,String,object,import)