java ÈÕÆÚ¸ñʽ»¯
1 SimpleDateFormatµ£µ±ÖØÈÎ,ÔõÑù¸ñʽ»¯¶¼ÐÐ
import java.util.Date;
import java.text.SimpleDateFormat;
public class Demo
{
public static void main(String[] args)
{
Date now=new Date();
SimpleDateFormat f=newSimpleDateFormat("½ñÌìÊÇ"+"yyyyÄêMMÔÂddÈÕ E kkµãmm·Ö");
System.out.println(f.format(now));
f=new SimpleDateFormat("a hhµãmm·ÖssÃë");
System.out.println(f.format(now));
}
}
2 ´Ó×Ö·û´®µ½ÈÕÆÚÀàÐ͵Äת»»£º
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import java.text.*;
publicclass Demo
{
public static void main(String[] args)
{
String strDate="2005Äê04ÔÂ22ÈÕ";
//×¢Ò⣺SimpleDateFormat¹¹Ô캯ÊýµÄÑùʽÓëstrDateµÄÑùʽ±ØÐëÏà·û
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyyÄêMMÔÂddÈÕ");
//±ØÐ벶»ñÒì³£
try
{
Date date=simpleDateFormat.parse(strDate);
System.out.println(date);
}
catch(ParseException px)
{
px.printStackTrace();
}
}
}
3 ½«ºÁÃëÊý»»×ª³ÉÈÕÆÚÀàÐÍ
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import java.text.*;
public class Demo
{
public static void main(String[] args)
{
long now=System.currentTimeMillis();
System.out.println("ºÁÃëÊý£º"+now);
Date dNow=new Date(now);
System.out.println("ÈÕÆÚÀàÐÍ£º"+dNow);
}
}
Õâ3ÀýÔ´×Ô[url]http://blog.csdn.net/zhoujian2003/archive/2005/04/22/358363.aspx[/url]
4 »ñȡϵͳʱÆÚºÍʱ¼ä£¬×ª»»³ÉSQL¸ñʽºó¸üе½Êý¾Ý¿â
([url]http://blog.csdn.net/netrope/archive/2005/11/19/532729.aspx[/url])
java.util.Date d=new java.util.Date(); //»ñÈ¡µ±Ç°ÏµÍ³µÄʱ¼ä
//¸ñʽ»¯ÈÕÆÚ
new java.text.SimpleDateFormat s= new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateStr = s.format(d); //תΪ×Ö·û´®
Ïà¹ØÎĵµ£º
public class javaTest {
public static void test(String ...strings){
for(String str: strings){
System.out.print(str + " ");
}
System.out.println();
}
public static void main(String[] args){
test("a", "b", "c", "ddd");
test( ......
1.ʵÀý³ÉÔ±ºÍÀà³ÉÔ±
ʵÀý³ÉÔ±ÖÐÊÇÊôÓÚ¶ÔÏóµÄ,°üÀ¨ÊµÀý³ÉÔ±±äÁ¿ºÍʵÀý³ÉÔ±·½·¨,Ö»Óд´½¨Á˶ÔÏóÖ®ºó²ÅÄÜ·ÃÎÊʵÀý³ÉÔ±±äÁ¿ºÍʵÀý³ÉÔ±·½·¨.
Àà³ÉÔ±ÊÇÊôÓÚÀàµÄ,Àà³ÉÔ±ÐèÒªÓùؼü×Östatic±êʶ,Ò²³ÆΪ¾²Ì¬³ÉÔ±,Àà³ÉÔ±°üÀ¨Àà³ÉÔ±±äÁ¿ºÍÀà³ÉÔ±·½·¨,ͨ¹ýÀàÃû¿ÉÒÔÖ±½Ó·ÃÎÊÀà³ÉÔ±±äÁ¿ºÍµ÷ÓÃÀà³ÉÔ±·½·¨,¼´Ê¹Ã»Óд´½ ......
¼¸ÌìÇ°£¬¸Õ¿´ÁËIBM DeveloperworksÉÏij¸ö¼¼Êõ´óÅ£×öµÄ¹ØÓÚÉè¼ÆREST·ç¸ñµÄJava MVC¿ª·¢¿ò¼ÜµÄÎÄÕ£¬½ñÌìÔÚGoogle CodeÉÏ·¢ÏÖÁËÒ»¸ö»ùÓÚJavaµÄREST·ç¸ñµÄMVC¿ª·¢¿ò¼Ü£¬È¡ÃûWebWind
¡£
“WebWindÊÇÒ»¸öJava MVC¿ò¼Ü¡£ºÍ³£¼ûµÄMVC¿ò¼ÜÈçStruts¡¢WebWork²»Í¬£¬WebWindÌìÉúÖ§³ÖÓû§ÓѺõÄURL£¬ÈÃWebÓ¦ÓóÌÐò¶ÔËÑË÷ÒýÇæ¸ü¼Ó ......
´Ó½ñÌ쿪ʼ, ÎÒÒª½«°ÑThinking in JavaµÄÿ¸öÀý×Ó¶¼ÇýøµçÄÔÀï, Ö»ÓÐÕâÑùÎÒµÄjava»ù´¡²Å»áÓÐÖʵÄÌá¸ß.
¼ÇµÃÒÔÇ°ÓÐÈË˵¹ý, ×µÄ·½·¨ÍùÍù¾ÍÊǽݾ¶,¹Ø¼üÔÚÓÚ¼á³Ö.
¼¼ÊõÒ²ÊÇÕâÑù.
½ñÌìÏÈ´Ó×Ô¼º½Ï¸ÐȤµÄType InformationÄÇÒ»ÕÂÇÃÆð.
ÇÃÁËÊ®¼¸¸öÎļþµÄ´úÂë, ¶ÔClass ÀàµÄʹÓÿÉνÊì͸ÁË. Ïà±ÈÒÔÇ°, ¹â¿´Êé²»Á·Ï°, ÏÖÔÚµÄÓ¡Ï ......
×¢Ê͵ÄÔÔò
1¡¢ ×¢ÊÍÐÎʽͳһ
ÔÚÕû¸öÓ¦ÓóÌÐòÖУ¬Ê¹ÓþßÓÐÒ»ÖµıêµãºÍ½á¹¹µÄÑùʽÀ´¹¹Ôì×¢ÊÍ¡£Èç¹ûÔÚÆäËûÏîÄ¿×é·¢ÏÖËûÃǵÄ×¢Ê͹淶ÓëÕâ·ÝÎĵµ²»Í¬£¬°´ÕÕËûÃǵĹ淶д´úÂ룬²»ÒªÊÔͼÔڼȳɵĹ淶ϵͳÖÐÒýÈëеĹ淶¡£
2¡¢ ×¢Ê͵ļò½à
ÄÚÈÝÒª¼òµ¥¡¢Ã÷ÁË¡¢º¬Òå׼ȷ£¬·ÀÖ¹×¢Ê͵ĶàÒåÐÔ£¬´íÎóµÄ×¢ÊͲ»µ«ÎÞÒæ·´¶øÓÐ ......