Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Time?

Posted on 2004-08-01
8
Medium Priority
?
159 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 2000 total points
ID: 11689184
Set a Calendar. Actually it'll already be holding those values when you create it
0
 
LVL 86

Expert Comment

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

Expert Comment

by:CEHJ
ID: 11689196
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Author Comment

by:Unimatrix_001
ID: 11689214
...I feel so stupid... how I didn't see that before!?!? :S ...Thanks CEHJ :-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 11689216
:-)
0
 
LVL 92

Expert Comment

by:objects
ID: 11689775
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
ID: 11704535
Is there a problem using the Calender class though?...
0
 
LVL 92

Expert Comment

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

916 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