请问!

xiejing1981314 2005-04-26 09:57:16
在db2在的datatime字段在java 中用那种数据类型表示呀?

还有就是我下面这样写错在那里呀?

Date today=new Date();
int time=today.getDate();
...全文
76 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
txranger 2005-04-26
  • 打赏
  • 举报
回复
> 在db2在的datatime字段在java 中用那种数据类型表示呀?

java.sql.Date.

> Date today=new Date();
> int time=today.getDate();

It's not wrong. It's just deprecated. The right way is:

Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
int dateOfTheMonth = calendar.get(Calendar.DATE);

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧