Now I go through the date and time. I can not just display the date and time on the screen. Please explain what's what.
3 answers
Try the Date.toString()
method - this is the easiest and surest way.
Update
If you need something more perverted, that is, the class SimpleDateFormat
, examples of handling it here
- 2Many thanks, very helpful! - rberla
- oneAnd how to make it so that it is updated in real time (I saw it somewhere, but in php) - rberla
|
Prints the current date on the "screen":
System.out.println(new Date(System.currentTimeMillis()));
UPDATE : result of code execution:
Sat Aug 18 00:11:32 EEST 2012
- It will be count. milliseconds elapsed with Epoch - rberla
- one> It will be count. milliseconds elapsed with Epoch I'm afraid to surprise you, but time is a relative value. The starting point may be different. And the code displays the date, not the number of ms :) - jmu
- oneIn fact, this is the implicit call
Date.toString()
:) - BarmaleyDate.toString()
- oneDid I deny it? :) - jmu
|
<? = date (Y)?>
- The question was about Java, but thanks - rberla
|