Jump to content

System time

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Ryanw327

Ryanw327

    Newbie

  • Members
  • PipPip
  • 13 posts
Hey so I was wondering how I could access the computers time in a program.

I have to write a pseudo program of my morning routine.

Thanks.

#2
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
System.currentTimeMillis()

#3
Metalhead

Metalhead

    Newbie

  • Members
  • PipPip
  • 27 posts
Depending on what you want to do with the time; currentTimeMillis gives you just a big number (the amount of milliseconds since 1970).
Normally you can just use Date d = new Date() which makes a new Date-object with the current date and time... with this you can get a formattable date.