Solved

Get hour from specify time

Posted on 2004-04-08
2
231 Views
Last Modified: 2010-03-31
My code:

Time currentTime = null;

then i will set the time to a value, then how can i get the hour of the time?

thanks
0
Comment
Question by:Kennywen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 25 total points
ID: 10781765
Calendar c = Calendar.getInstance();
c.setTime(time);
int h = c.get(Calendar.HOUR);
0
 

Author Comment

by:Kennywen
ID: 10781792
Object can u help me to view on my existing question:

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20947248.html

thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ejb stateless example 2 43
Convert from a json string array to a Java object 3 64
eclipse console opening separately 2 38
Glassfish admin console not working 1 59
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

733 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