JAVAµÄÈÕÆÚÓ¦ÓãºDate¡¢DateFormat¡¢Calendar
¾ßÌåÀà(ºÍ³éÏóÀàÏà¶Ô)java.util.Date
³éÏóÀàjava.text.DateFormat ºÍËüµÄÒ»¸ö¾ßÌå×ÓÀà,java.text.SimpleDateFormat
³éÏóÀàjava.util.Calendar ºÍËüµÄÒ»¸ö¾ßÌå×ÓÀà,java.util.GregorianCalendar
¾ßÌåÀà¿ÉÒÔ±»ÊµÀý»¯, µ«ÊdzéÏóÀàÈ´²»ÄÜ. ÄãÊ×ÏȱØÐëʵÏÖ³éÏóÀàµÄÒ»¸ö¾ßÌå×ÓÀà¡£
DateÀࣺ
DateÀàʵ¼ÊÉÏÖ»ÊÇÒ»¸ö°ü¹üÀà, Ëü°üº¬µÄÊÇÒ»¸ö³¤ÕûÐÍÊý¾Ý, ±íʾµÄÊÇ´ÓGMT(¸ñÁÖÄáÖαê׼ʱ¼ä)1970Äê, 1ÔÂ1ÈÕ00:00:00ÕâÒ»¿Ì֮ǰ»òÕßÊÇÖ®ºó¾ÀúµÄºÁÃëÊý¡£
DateÀà³£ÓõÄÁ½¸ö¹¹Ô캯Êý£º
Date()ÎÞ²ÎÊýµÄ¹¹Ô캯Êý´´½¨µÄ¶ÔÏó¿ÉÒÔ»ñÈ¡±¾µØµ±Ç°Ê±¼ä¡£
Date(long time)ʹÓÃÒ»¸ö´ÓGMT(¸ñÁÖÄáÖαê׼ʱ¼ä)1970Äê, 1ÔÂ1ÈÕ00:00:00ÕâÒ»¿Ì֮ǰ»òÕßÊÇÖ®ºó¾ÀúµÄºÁÃëÊý´´½¨Ò»¸öDate¶ÔÏó
DateʾÀý£º
Date date = new Date();
System.out.println(date.getTime()); //1228061164796
System.out.println(date.toString()); //Mon Dec 01 00:06:04 CST 2008
ÈÕÆÚÊý¾ÝµÄ¶¨ÖƸñʽ£º(DateFormatÀà¡¢SimpleDateFormatÀà)
ΪÁ˶¨ÖÆÈÕÆÚÊý¾ÝµÄÊä³ö¸ñʽ£¬ÎÒÃÇ¿ÉÒÔʹÓÃDateFormatµÄ×ÓÀàSimpleDateFormat¡£SimpleDateFormatÓиö³£Óù¹Ôì·½·¨£º
public SimpleDateFormat(String pattern) //patternÖ¸¶¨Êä³ö¸ñʽ
patternÖпÉÒÔÓÐÈçϸñʽ·û£º
y,yy:ÓÃ2λÊý×Ö±íʾµÄ"Äê"Ìæ»»¡£
yyyy:ÓÃ4λÊý×Ö±íʾµÄ"Äê"Ìæ»»¡£
M,MM:ÓÃ2λÊý×Ö±íʾµÄ"ÔÂ"Ìæ»»¡£
MMM:Óúº×Ö±íʾµÄ"ÔÂ"Ìæ»»¡£
d,dd:ÓÃ2λÊý×Ö±íʾµÄ"ÈÕ"Ìæ»»¡£
H,HH:ÓÃ2λÊý×Ö±íʾµÄ"ʱ"Ìæ»»¡£
m,mm:ÓÃ2λÊý×Ö±íʾµÄ"·Ö"Ìæ»»¡£
s,ss:ÓÃ2λÊý×Ö±íʾµÄ"Ãë"Ìæ»»¡£
E:ÓÃ"ÐÇÆÚ"Ìæ»»
patternÖеÄÆÕͨASCII×Ö·û£¬±ØÐëÓõ¥ÒýºÅ“'”×Ö·ûÀ¨ÆðÀ´£¬È磺
pattern="'time':yyyy-MM-dd";
ÓÃSimpleDateFormat¶ÔÏóµ÷ÓÃÈçÏ·½·¨¿ÉÒÔ¶¨ÖÆijʱ¼äÊä³ö¸ñʽ£º
public String format(Date date)
ʵÀý£º
SimpleDateFormat sdf = new SimpleDateFormat(" 'time':yyyy-MM-dd");
System.out.println(sdf.format(date)); // time:2008-12-01
¼ÙÈçÎÒÃÇÓÉÒ»¸öÎı¾×Ö·û´®°üº¬Ò»¸ö¸ñʽ»¯
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
Ò»£º×¼±¸ www.savarese.org download
1. rocksaw-1.0.0-src.tar.gz
2. vserv-tcpip-0.9.2-src.tar.gz
¶þ£º±àÒëÔ´ÎļþµÃµ½jar°ü ʹÓÃAnt
1. build vserv-tcpip-0.9.2-src
ÔÚvserv-tcpip-0.9.2Ŀ¼ÏÂÃ潨һ¸ötestsĿ¼£¬È»ºóÔÚcmd´°¿ÚϽøÈë ......
ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......
1¡¢FACTORY—×·MMÉÙ²»ÁËÇë³Ô·¹ÁË£¬Âóµ±À͵ļ¦³áºÍ¿ÏµÂ»ùµÄ¼¦³á¶¼ÊÇMM°®³ÔµÄ¶«Î÷£¬ËäÈ»¿ÚζÓÐËù²»Í¬£¬µ«²»¹ÜÄã´øMMÈ¥Âóµ±ÀÍ»ò¿ÏµÂ»ù£¬Ö»¹ÜÏò·þÎñԱ˵“À´Ëĸö¼¦³á”¾ÍÐÐÁË¡£Âóµ±ÀͺͿϵ»ù¾ÍÊÇÉú²ú¼¦³áµÄFactory
¡¡¡¡¹¤³§Ä£Ê½£º¿Í»§ÀàºÍ¹¤³§Àà·Ö¿ª¡£Ïû·ÑÕßÈκÎʱºòÐèҪijÖÖ²úÆ·£¬Ö»ÐèÏò¹¤³§ÇëÇó¼´¿É¡£Ïû·ÑÕ ......
Java֮·¼Æ»®
˵Ã÷£ºÓÉÓÚÎÒÃÇÍŶÓÆäËû³ÉÔ±¶¼²»ÊÇ×öjava¿ª·¢µÄ£¬µ«ÊÇÂíÉ϶¼Òª¼¯ÌåתÏòJava£¬ËùÒÔÊÇÎÒÕûÀíÁËһϣ¬»¹ÊDZȽÏÊÊÓÃÓÚ³õѧÕߵģ¬¸ßÊÖÃÇÒ²¿ÉÒÔÌáÌáÒâ¼û
ÔÚ¿ªÊ¼Õâ¸ö¼Æ»®Ç°£¬ÎÒÏ뻹ÊÇÏëºÍ´ó¼Ò·ÖÏíÒ»ÏÂÎÒ¶ÔδÀ´Java֮·µÄã¿ã½£¬ËäÈ»JavaµÄĸ¹«Ë¾SunÔÚ¾ÊÜ×ÅOracle¹«Ë¾ÊÕ¹º£¬µ¼ ......