Questions tagged «minute»



3
Java getHours(),getMinutes()和getSeconds()
据我所知getHours(),getMinutes()并getSeconds()在Java中都被弃用,它们与更换Calendar.HOUR_OF_DAY,Calendar.MINUTE,Calendar.SECOND。 实际上,这些将返回该特定时刻的小时,分​​钟和秒。但是,我想从Date变量中检索小时和分钟。例如, 说从数据库中检索的时间是 time = Thu Jan 01 09:12:18 CET 1970; int hours = time.getHours(); int minutes = time.getMinutes(); int seconds = time.getSeconds(); 通过检索小时,分钟和秒,我得到 hours = 9 minutes = 12 seconds = 18 那么,如何将日历用于此功能?尽管getHours()已弃用,但仍然有效。我仍然想知道是否有替代方法。
81 java  date  hour  seconds  minute 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.