javaµ±Ç°ÏµÍ³Ê±¼äµÄ»ñÈ¡
import ? java.text.SimpleDateFormat; ? ? ??
?
SimpleDateFormat ? formatter ? = ? new ? SimpleDateFormat ? ("yyyyÄêMMÔÂddÈÕ ? HH:mm:ss ? ? "); ? ? ??
Date ? curDate ? = ? new ? Date(System.currentTimeMillis());//»ñÈ¡µ±Ç°Ê±¼ä ? ? ??
String ? str ? = ? formatter.format(curDate); ? ? ?
?
import ? java.text.SimpleDateFormat; ? ?
?
SimpleDateFormat ? formatter ? = ? new ? SimpleDateFormat ? ("yyyyÄêMMÔÂddÈÕ ? HH:mm:ss ? ? "); ? ?
Date ? curDate ? = ? new ? Date(System.currentTimeMillis());//»ñÈ¡µ±Ç°Ê±¼ä ? ?
String ? str ? = ? formatter.format(curDate); ? ?
¿ÉÒÔ»ñÈ¡µ±Ç°µÄÄêÔÂʱ·Ö,Ò²¿ÉÒÔ·Ö¿ªÐ´: ?
?
?
SimpleDateFormat ? sDateFormat ? = ? new ? SimpleDateFormat("yyyy-MM-dd ? hh:mm:ss"); ? ? ??
String ? date ? = ? sDateFormat.format(new ? java.util.Date()); ??
?
SimpleDateFormat ? sDateFormat ? = ? new ? SimpleDateFormat("yyyy-MM-dd ? hh:mm:ss"); ? ?
String ? date ? = ? sDateFormat.format(new ? java.util.Date()); Èç¹ûÏë»ñÈ¡µ±Ç°µÄÄêÔÂ,Ôò¿ÉÒÔÕâÑùд(Ö»»ñȡʱ¼ä»òÃëÖÖÒ»Ñù): ?
?
?
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM"); ? ?
String date=sdf.format(new java.util.Date()); ??
?
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM"); ?
String date=sdf.format(new java.util.Date()); µ±È»»¹ÓоÍÊÇ¿ÉÒÔÖ¸¶¨Ê±ÇøµÄʱ¼ä(´ý): ?
?
df=DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL,Locale.CHINA); ? ?
? System.out.println(df.format(new ? Date())); ?