2 Replies - 576 Views - Last Post: 19 November 2010 - 08:59 AM

#1 Necrofenser  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-November 10

Date variable

Posted 19 November 2010 - 05:19 AM

Hello!
I am developing one application (for Mobile phone) and I need help. I want to make something like this:
When user starts the application he can see current date and under date is some code. For every date, the code is different (today is 12345, tomorrow is 2345 etc). What's driving my gears is that I don't know how to make date variable (how to see current date on phone) and by the date to show specific code.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Date variable

#2 raymens  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 42
  • Joined: 02-June 10

Re: Date variable

Posted 19 November 2010 - 07:55 AM

Are you using Java ME or...?
If you are, then this should do the job according to the API. This allocates a Date object and initializes it to represent the current time specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.


Date dateObj = new Date();

Was This Post Helpful? 0
  • +
  • -

#3 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10561
  • View blog
  • Posts: 39,084
  • Joined: 27-December 08

Re: Date variable

Posted 19 November 2010 - 08:59 AM

*Moved to Mobile Development*

@raymens: The java.util.Date Object is available for all versions of Java, including ME, SE, Android, and EE. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1