Solved

Time?

Posted on 2004-08-01
8
149 Views
Last Modified: 2010-03-31
Hello.

I'm wanting to store the following information about the current LOCAL time:

Year, Month, Day, Hour, Minute, Second, Millisecond.

Although I'm not quite sure about how to store it. I don't think there's a type that can store that including the seconds is there? How do I get the GMT time for this also?
0
Comment
Question by:Unimatrix_001
  • 4
  • 2
  • 2
8 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
Comment Utility
Set a Calendar. Actually it'll already be holding those values when you create it
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
0
 
LVL 3

Author Comment

by:Unimatrix_001
Comment Utility
...I feel so stupid... how I didn't see that before!?!? :S ...Thanks CEHJ :-)
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
:-)
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
You don't actually need a Calendar, the Date class can be used instead

Date today = new Date();
0
 
LVL 3

Author Comment

by:Unimatrix_001
Comment Utility
Is there a problem using the Calender class though?...
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
No its just extra overhead, if you don't actually need then a Date would suffice.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

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

11 Experts available now in Live!

Get 1:1 Help Now