ÈçºÎÀûÓÃjavaµÃµ½µ±Ç°µÄʱ¼äºÍÇ°Ò»ÌìµÄʱ¼ä
1.µÃµ½µ±Ç°µÄʱ¼ä
Calendar cal = Calendar.getInstance();
String time=formatter.format(cal.getTime());
String strEnd=time.substring(0, 16);// 2007-10-30 09:30
Calendar cal = Calendar.getInstance();
String time=formatter.format(cal.getTime());
String strEnd=time.substring(0, 16);// 2007-10-30 09:30
2.µÃµ½Ç°Ò»ÌìµÄʱ¼ä
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_MONTH, -1);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String mDateTime=formatter.format(c.getTime());
String strStart=mDateTime.substring(0, 16);//2007-10-29 09:30
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_MONTH, -1);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String mDateTime=formatter.format(c.getTime());
String strStart=mDateTime.substring(0, 16);//2007-10-29 09:30
3.µÃµ½Ç°¼¸ÌìµÄʱ¼ä
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_MONTH, -5);//µÃµ½Ç°5
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String mDateTime=formatter.format(c.getTime());
String strStart=mDateTime.substring(0, 16);//2007-10-24 09:30
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_MONTH, -5);//µÃµ½Ç°5
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String mDateTime=formatter.format(c.getTime());
String strStart=mDateTime.substring(0, 16);//2007-10-24 09:30
4.µÃµ½µ±Ç°Ê±¼äµÄÇ°¼¸ÄêµÄʱ¼ä
Calendar c = Calendar.getInstance();
c.add(Calendar.YEAR, -5);//µÃµ½Ç°5Äê
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String mDateTime=formatter.format(c.getTime());
String strStart=mDateTime.substring(0, 16);//2002-10-24 09:30
Calendar c = Calendar.getInstance();
c.add(Calendar.YEAR, -5);//µÃµ½Ç°5Äê
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm
Ïà¹ØÎĵµ£º
/**
* µÃµ½±¾ÖÜÖÜÒ»
*
* @return yyyy-MM-dd
*/
public static String getMondayOfThisWeek() {
Calendar c = Calendar.getInstance();
int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
if (day_of_week == 0)
da ......
ÔÎÄ£ºhttp://zhaosoft.javaeye.com/blog/243586
Java
»ù±¾¸ÅÄ¼¯ºÏÀࣨCollection
£© List
/Set/Map µÄÇø±ðºÍÁªÏµ
Collection
£ºList
¡¢Set
Map£ºHashMap¡¢HashTable
ÈçºÎÔÚËüÃÇÖ®¼äÑ¡Ôñ
Ò»¡¢Array £¬ Arrays
Java
ËùÓГ´æ´¢¼°Ëæ»ú·ÃÎÊÒ»Á¬´®¶ÔÏó”µÄ×ö·¨£¬arrayÊÇ×îÓÐЧÂʵÄÒ»ÖÖ¡£
1¡¢ ......
ºÜ¶àÍøÓÑÎÊÎÒѧϰJavaÓÐûÓÐʲô½Ý¾¶,ÎÒ˵“ÎÞËû£¬Î¨ÊÖÊì¶û”¡£µ«ÊÇÎÒÈ´ºÜÔ¸Ò⽫×Ô¼ºÑ§Ï°µÄһЩ¾Ñéд³öÀ´£¬ÒÔ±ãºóÀ´ÕßÉÙ×ßÍä·,°ïÖú±ðÈËÊÇ×î´óµÄ¿ìÀÖÂ
ÒªÏëѧºÃJava£¬Ê×ÏÈÒªÖªµÀJavaµÄ´óÖ·ÖÀà¡£ÎÒÃÇÖªµÀ£¬×Ô´ÓSunÍƳöJavaÒÔÀ´£¬¾ÍÁ¦Í¼Ê¹Ö®ÎÞËù²»°ü£¬ËùÒÔJava·¢Õ¹µ½ÏÖÔÚ£¬°´Ó¦ÓÃÀ´·ÖÖ÷Òª·ÖΪÈý´ó¿é£ºJ2SE,J2 ......
#(¶Á×ö "C sharp")ÊÇ΢Èí¹«Ë¾ÔÚÈ¥ÄêÁùÔ·¢²¼µÄÒ»ÖÖеıà³ÌÓïÑÔ,²¢¶¨ÓÚÔÚ΢ÈíÖ°Òµ¿ª·¢ÕßÂÛ̳(PDC)ÉϵÇ̨ÁÁÏà.C#ÊÇ΢Èí¹«Ë¾Ñо¿Ô±Anders HejlsbergµÄ×îгɹû.C#¿´ÆðÀ´ÓëJavaÓÐמªÈ˵ÄÏàËÆ;Ëü°üÀ¨ÁËÖîÈçµ¥Ò»¼Ì³Ð,½çÃæ,ÓëJava¼¸ºõͬÑùµÄÓï·¨,ºÍ±àÒë³ÉÖмä´úÂëÔÙÔËÐеĹý³Ì.µ«ÊÇC#ÓëJavaÓÐ×ÅÃ÷ÏԵIJ»Í¬,Ëü½è¼øÁËDelphiµÄÒ»¸ ......