日期:2014-05-20  浏览次数:20622 次

Timestamp与String类型的转换



Timestamp urlTime = getCxtDate();

为何返回不来值?



//MyService.getCxtDate()
public static Timestamp getCxtDate(){
    Timestamp dateStr = java.sql.Timestamp.valueOf(Util.getCxnDate());
    return dateStr;


}


//Util.getCxtDate()
public static String getCxnDate(){[code=java]

    Date now = new Date();
    DateFormat date = DateFormate.getDateTimeInstance();
    String currentDate = date.format(now);
    return currentDate;

}
[/code]
Timestamp J2SE String Java

------解决方案--------------------
Timestamp是一个对象 不是一个数组所以是不可以的么?