关于jdbc中

microfshao 2003-10-16 05:25:31
今天在使用jdbc时,发现里面有getDate(int,Calendar),java document中说Retrieves the value of the designated JDBC DATE parameter as a java.sql.Date object, using the given Calendar object to construct the date. With a Calendar object, the driver can calculate the date taking into account a custom timezone and locale. If no Calendar object is specified, the driver uses the default timezone and locale
对于date来说怎么可能有时区的概念,不知道这是怎么回事
...全文
53 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
liushenling 2003-10-16
  • 打赏
  • 举报
回复
你可以参考一下calendar的说明;比如:
Calendar(TimeZone zone, Locale aLocale) --Constructs a calendar with the specified time zone and locale.好比我们老说北京时间和GMT时间是不一样的,和美国东部时间也不一样!
whyxx 2003-10-16
  • 打赏
  • 举报
回复
date类的确有时区的概念,因为他是取系统的时间,系统是有时区设置的
xuewuz 2003-10-16
  • 打赏
  • 举报
回复
计算机的时区设置的不同,显示的当前时间当然也不同了,生成Date所得到的时间亦不同了

62,612

社区成员

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

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