编写一个日期功能类:DateFunction 有如下方法:
(1) public static java.uitl.Date getCurrentDate() //取得当前日期
(2 )public static String getCurrentShortDate () //返回当前年月日格式日期:yyyy-mm-dd
(3) public static String getCurrentDateTime() //取得当前日期和时间 格式:yyyy-mm-dd hh:mi:ss
(4) public static String getCurrentChineseDate() //返回 “yyyy年xx月xx日”格式的日期
(5) public static java.util.Date convertToDate(String currentDate) throws Exception //将字符串日期转换为日期类型, 字符串格式为:yyyy-mm-dd, 如果转换失败,抛出转换异常
(6) public static java.util.Date convertToLongDate(String currentDate) throws ConvertException //将日期时间:yyyy-mm-dd hh:mi:ss 转换为日期类型,如果转换失败抛出转换异常。
(7) public static String convertToDateString(java.sql.Date date) //将日期类型转换为字符串类型,格式:yyyy-mm-dd
(8) public static String convertToDateTimeString(java.sql.Date date) //将日期转换为字符串,格式为:yyyy-mm-dd hh:mi:ss
编写测试类Test,对所有方法进行测试。