JAVA Calendar???????
???????????? ???????[ 2015/2/15 14:35:49 ] ????????Java ???????
?????????????????????????????r
???????????????????????????????????????????????? ?????????????????????????????????????????????????. ???????????????????"MM-dd-yyyy" ????SimpleDateFormat?? ????????Σ? ???????????????????????????????????????. ??????????? ????????£? ??????????????"9-29-2001"???????????001736000000 ?????????.
????????????:
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateExample3 {
public static void main(String[] args) {
// Create a date formatter that can parse dates of
// the form MM-dd-yyyy.
SimpleDateFormat bartDateFormat =
new SimpleDateFormat("MM-dd-yyyy");
// Create a string containing a text date to be parsed.
String dateStringToParse = "9-29-2001";
try {
// Parse the text version of the date.
// We have to perform the parse method in a
// try-catch construct in case dateStringToParse
// does not contain a date in the format we are expecting.
Date date = bartDateFormat.parse(dateStringToParse);
// Now send the parsed date as a long value
// to the system output.
System.out.println(date.getTime());
}
catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
}
??????????????????????????
??????????????????????????????????????? ?????????????????????????????????. ???? DateFormat.getDateTimeInstance() ??????????ü?????????????????????????????. ?????μ??????У? ????????????????????????????. ?????????????? ?е??? ????? ??????????????.
import java.text.DateFormat;
import java.util.Date;
public class DateExample4 {
public static void main(String[] args) {
Date date = new Date();
DateFormat shortDateFormat =
DateFormat.getDateTimeInstance(
DateFormat.SHORT??
DateFormat.SHORT);
DateFormat mediumDateFormat =
DateFormat.getDateTimeInstance(
DateFormat.MEDIUM??
DateFormat.MEDIUM);
DateFormat longDateFormat =
DateFormat.getDateTimeInstance(
DateFormat.LONG??
DateFormat.LONG);
DateFormat fullDateFormat =
DateFormat.getDateTimeInstance(
DateFormat.FULL??
DateFormat.FULL);
System.out.println(shortDateFormat.format(date));
System.out.println(mediumDateFormat.format(date));
System.out.println(longDateFormat.format(date));
System.out.println(fullDateFormat.format(date));
}
}
?????????????? getDateTimeInstance????ε????ж????????????. ???????????????? ?????????????????. ??????????????????int(????). ??????????? ?????????DateFormat ?????????: SHORT?? MEDIUM?? LONG?? ??FULL. ???????????????????????????????????????? ??Sun ???Web?????????.
???????????????????????? ????????????豸??????μ?????:
????9/29/01 8:44 PM
????Sep 29?? 2001 8:44:45 PM
????September 29?? 2001 8:44:45 PM EDT
????Saturday?? September 29?? 2001 8:44:45 PM EDT
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????

???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????