Solved

Calendar.HOUR_OF_DAY at midnight

Posted on 2013-11-29
2
343 Views
Last Modified: 2013-11-29
hi experts

I have this code using java 7:

Calendar cal = Calendar.getInstance() ;
int hours = cal.get(Calendar.HOUR_OF_DAY) ;

Open in new window


If the program is running at 12 AM , will hours be 23, 24 or 00 ?

thx
0
Comment
Question by:royjayd
2 Comments
 
LVL 26

Accepted Solution

by:
dpearson earned 300 total points
Comment Utility
Midnight is 0

Doug
0
 

Author Closing Comment

by:royjayd
Comment Utility
thanks, any help with this question will be greatly appreciated
http://www.experts-exchange.com/Programming/Languages/Java/Q_28306670.html
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now