Solved

Dealing with 'time'.

Posted on 2003-11-27
4
222 Views
Last Modified: 2010-03-31
I'm working on an application where I want to give an object on creation, a time attribute so that i can later compare it's time of creation with the current time.

What's a good way to do this?

The Calendar class? though, getTimeInMillis() and setTimeInMillis()methods are protected so do I need a class of my own to extend Calendar before I can use these methods?
0
Comment
Question by:RedRichard
[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
  • 3
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9833324
long createdAt = System.getTimeMillis();

should do
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 50 total points
ID: 9833327
Sorry, that's

long createdAt = System.currentTimeMillis() ;
0
 

Author Comment

by:RedRichard
ID: 9833355
Thanks, had a feeling there would be a quick way.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9833363
:-)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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 tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

687 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