Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7574461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:26:30+00:00 2026-05-30T16:26:30+00:00

I have recently started learning java for creating android apps. I have spent hours

  • 0

I have recently started learning java for creating android apps. I have spent hours and hours looking for the right code to be able to use the current time and date as an int. I’m sure it’s very easy but I can’t seem to find the correct coding. My first app im creating it will be crucial for a number to increase with time. Thank you for your help!

Chris

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:26:32+00:00Added an answer on May 30, 2026 at 4:26 pm

    You can use it as a long, see javadocs:

    • http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Date.html#getTime()

    But why would you do it, that’s another question… Choose wisely 🙂 Nothing wrong with having dates represented as numbers per se, but any calculations are bound to hit some of the numerous corner cases – you might want to look at this SOq for one really mind-boggling examples:

    • Why is subtracting these two times (in 1927) giving a strange result?

    and this SOq for a bunch of best practices:

    • Daylight saving time and time zone best practices

    If you are interested in any date calculations, you may want to look at Joda Time library:

    • http://joda-time.sourceforge.net/

    I’d say that when you have such good and well tested libraries readily available, it’s rarely a good idea to go your own way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started looking into Google Charts API for possible use within the
I have recently started learning wpf and am trying to use mvvm. My understanding
I have recently started learning java as my first ever step into object oriented
I have recently started learning Java EE 6 and I could need some help.
I have recently just started learning how to develop android applications. I am am
I just recently started learning Java. I have a question which is more about
I have recently started learning Android development. In the android-sdk/tools folder, there should be
I have recently started learning F#, and this is the first time I've ever
I have recently started learning Perl and one of my latest assignments involves searching
I've been a web developer for some time now, and have recently started learning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.