java ÈÕÆÚ²î ʵÏÖ(×·ÖÖÓǰ)¹¦ÄÜ
½ñÌì¾ÀíÈÃдһ¸ö£¬¸ù¾ÝÐÅÏ¢ÉÏ´«Ê±¼ä£¬ÏÔʾ£¬£¿·ÖÖÓǰ£¬£¿Ð¡Ê±Ç°£¬£¿Ììǰ£¬ÀàËÆqq¿Õ¼ä·¢±íµÄÐÄÇéÈÕÆÚ£»
ÓÃÁËÒ»¸ö×ÔÎҸоõ±¿µÄ·½·¨£¬²»¹ý»¹ÊÇʵÏÖÁË£¬ºÇºÇºÇ
public static String getCompareTime(String filetime){
//·µ»ØµÄ×Ö·û´®
String retStr ="";
//´«ÈëµÄÈÕÆÚÊÇ2008-9-12µÈ£¬²»×÷´¦Àí
if(filetime.indexOf("-")>0){
retStr =filetime;
}
else{
try{
DateFormat day = new SimpleDateFormat("dd");
DateFormat hour = new SimpleDateFormat("HH");
DateFormat minute = new SimpleDateFormat("mm");
Date today = new Date();
//µÃµ½µ±Ç°Ê±¼äµÄÈÕ£¬Ð¡Ê±£¬·ÖÖÓ
int nowDay =Integer.parseInt(day.format(today));
int nowHour =Integer.parseInt(hour.format(today));
int nowMinute =Integer.parseInt(minute.format(today));
// System.out.println("nowDay:"+nowDay);
// System.out.println("nowDay:"+nowHour);
// System.out.println("nowDay:"+nowMinute);
//¸ñʽ»¯´«ÈëµÄ×Ö·û´®
DateFormat df = new SimpleDateFormat("yy/MM/dd HH:mm:ss");
Date dataTime = df.parse(filetime);
//µÃµ½´«Èëʱ¼äµÄÈÕ£¬Ð¡Ê±£¬·ÖÖÓ
int dataDay =Integer.parseInt(day.format(dataTime));
int dataHour =Integer.parseInt(hour.format(dataTime));
&n
Ïà¹ØÎĵµ£º
StringÀàÖеĹ¹Ô캯Êý
String(); ¹¹ÔìÒ»¸ö¿Õ×Ö·û´®¶ÔÏó
String(byte[] bytes); ͨ¹ýbyteÊý×é¹¹Ôì×Ö·û´®¶ÔÏó
String(byte[] bytes,int offset,int length);ͨ¹ýbyteÊý×飬´Óoffset¿ªÊ¼£¬×ܹ²length³¤µÄ×Ö½Ú¹¹Ôì×Ö·û´®¶ÔÏó
String(char[] value); ͨ¹ýcharÊý×é¹¹Ôì×Ö·û´®¶ÔÏó
String(byte[] char,int offset,int length) ......
Java NIOÀà¿âSelector»úÖÆ½âÎö£¨ÉÏ£©
ÕÔï¿¡¡¡¡ ³Âð©
http://blog.csdn.net/haoel
Ò»¡¢ ǰÑÔ
×Ô´ÓJ2SE 1.4°æ±¾ÒÔÀ´£¬JDK·¢²¼ÁËȫеÄI/OÀà¿â£¬¼ò³ÆNIO£¬Æä²»µ«ÒýÈëÁËȫеĸßЧµÄI/O»úÖÆ£¬Í¬Ê±£¬Ò²ÒýÈëÁ˶à·¸´ÓõÄÒ첽ģʽ¡£NIOµÄ°üÖÐÖ÷Òª°üº¬ÁËÕâÑù¼¸ÖÖ³éÏóÊý¾ÝÀàÐÍ£º
......
Java NIOÀà¿âSelector»úÖÆ½âÎö£¨Ï£©
ÕÔï¿¡¡¡¡ ³Âð©
http://blog.csdn.net/haoel
<<<<µã´Ë²é¿´±¾ÎÄÉÏÆª
Îå¡¢ ÃÔ»ó²»½â : ΪʲôҪ×Ô¼ºÏûºÄ×ÊÔ´£¿
ÁîÈ˲»½âµÄÊÇΪʲôÎÒÃǵÄJavaµÄNew I/OÒªÉè¼Æ³ÉÕâ¸öÑù×Ó£¿Èç¹û˵ÀϵÄI/O²»Äܶà·¸´Óã¬ÈçÏÂͼËùʾ£¬Òª¿ªN¶àµÄÏß³ÌÈ¥ ......
java¼ÆËãʱ¼ä²î
ÎÄÕ·ÖÀà:Java±à³Ì
±ÈÈ磺ÏÖÔÚÊÇ2004-03-26 13£º31£º40
¹ýÈ¥ÊÇ£º2004-01-02 11£º30£º24
ÎÒÏÖÔÚÒª»ñµÃÁ½¸öÈÕÆÚ²î£¬²îµÄÐÎʽΪ£ºXXÌìXXСʱXX·ÖXXÃë
·½·¨Ò»£º
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try
{
Date d1 = df.parse("2004-03-26 13:31:40");
......
ÔÚͨ¹ýDNS²éÕÒÓòÃûµÄ¹ý³ÌÖУ¬¿ÉÄܻᾹý¶ą̀ÖмäDNS·þÎñÆ÷²ÅÄÜÕÒµ½Ö¸¶¨µÄÓòÃû£¬Òò´Ë£¬ÔÚDNS·þÎñÆ÷ÉϲéÕÒÓòÃûÊǷdz£°º¹óµÄ²Ù×÷¡£ÔÚJavaÖÐΪÁË»º½âÕâ¸öÎÊÌ⣬ÌṩÁËDNS»º´æ¡£µ±InetAddressÀàµÚÒ»´ÎʹÓÃij¸öÓòÃû£¨Èçwww.csdn.net£©´´½¨InetAddress¶ÔÏóºó£¬JVM¾Í»á½«Õâ¸öÓòÃûºÍËü´ÓDNSÉÏ»ñµÃµÄÐÅÏ¢£¨ÈçIPµØÖ·£©¶¼±£´æÔÚDNS»º´æÖ ......