Forums Register Login

calendar.setTime(date)

+Pie Number of slices to send: Send
Hi all, I want to get the hour of day in 24hour cycle. I know that date.getHours() is depreciated. But I'm tempted to use it since I can not get the same result out of calendar.hour call.
It seems call calendar.setTime(now) does not pick up the current date value. Anybody knows what's going on here? I have the following:

1
+Pie Number of slices to send: Send
Values such as c.HOUR do not return the hour of the date. They are constants used with the API to identify date fields.

Consider: c.get(Calendar.HOUR)
+Pie Number of slices to send: Send
I cant tell you how thankful I am! Thanks so much!
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:Values such as c.HOUR do not return the hour of the date. They are constants used with the API to identify date fields.

Consider: c.get(Calendar.HOUR)



Thank you so much.
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2161 times.
Similar Threads
java.sql.Date to java.util.Calendar
Bug in java.util.Date.toString():?
Date calculation
Adding three weeks to a date
Create an Array of Weeks
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:24:52.