Java??????????????ж??????
???????????? ???????[ 2013/7/30 10:26:48 ] ????????
????????????
???????????
????SimpleDateFormat ?????????????????й??????????????????????????????????и?????????? -> ???????????????? -> ???????淶????
?????????????????????????? ????????????????????????????У?δ?????????? 'A' ?? 'Z' ?? 'a' ?? 'z' ????????????????????????????????????????????????????? (') ??????????????н????"''" ??????????????????????????????????????????????????????????????????????????????????????????
??????????????
/**
* ????????
* <p>??????е?????
* <p>G Era
* <p>y ?? Year
* <p>M ???е??·?
* <p>w ???е?????
* <p>W ?·??е?????
* <p>D ???е?????
* <p>d ?·??е?????
* <p>F ?·??е?????
* <p>E ?????е?????
* <p>a Am/pm ???
* <p>H ?е?С?????0-23??
* <p>k ?е?С?????1-24??
* <p>K am/pm ?е?С?????0-11??
* <p>h am/pm ?е?С?????1-12??
* <p>m С??е??????
* <p>s ?????е?????
* <p>S ??????
* <p>z ???
* <p>Z ???
*
* ?????"yyyy.MM.dd G 'at' HH:mm:ss z"??
* ???2001.07.04 AD at 12:08:56 PDT ??
* ???????е???????Сд??С?
* @return ?????????????????????????磺19:56:43??
*/
public static String getSystemTime()
{
//?????????????????
Calendar calendar = Calendar.getInstance();
//???????????
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
//???????????л??Date???????????????????????
String time = simpleDateFormat.format(calendar.getTime());
return time;
}
??????ж??????
???????????????
??????????????????????web.xml???????????????????web.xml???????????????????????????£?
<listener>
<listener-class>com.test.time.ScheduleTask</listener-class>
</listener>
???????У?com.test.time.ScheduleTask???????????????????????javax.servlet.ServletContextListener;??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11