How do I display the current time *including milliseconds*?
Hello,
I need to display the current time including milliseconds. The following
code:
DateFormat dfDateTimeStartupThread =
DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL,Locale.getDef
ault());
String sDateTimeStartupThread = dfDateTimeStartupThread.format(new Date());
System.out.println(sDateTimeStartupThread);
results in output like:
June 25, 2005 1:23:18 PM EST
which is nicely formatteed but I cannot find any way to get the milliseconds
to display.
How can this be done?
Thanks,
Al Koch,
AlKoch@MyRealBoxREMOVEALLTHESECHARS.com
Raymond DeCampo - 25 Jun 2005 21:56 GMT
> How do I display the current time *including milliseconds*?
Take a look at java.util.SimpleDateFormat.
HTH,
Ray

Signature
XML is the programmer's duct tape.
Al Koch - 27 Jun 2005 06:22 GMT
Hi Ray,
> Take a look at java.util.SimpleDateFormat.
Thanks very much; that was exactly what I needed! (although it's actually
java.text.SimpleDateFormat).
Al,
AlKoch@MyRealBoxREMOVEALLTHESECHARS.com
Raymond DeCampo - 27 Jun 2005 13:41 GMT
> Hi Ray,
>
>>Take a look at java.util.SimpleDateFormat.
>
> Thanks very much; that was exactly what I needed! (although it's actually
> java.text.SimpleDateFormat).
Of course, I make that mistake every time...
Ray

Signature
XML is the programmer's duct tape.
Joly Makunga - 30 Jun 2005 10:40 GMT
> How do I display the current time *including milliseconds*?
>
[quoted text clipped - 21 lines]
> Al Koch,
> AlKoch@MyRealBoxREMOVEALLTHESECHARS.com
i do it like that
Date madate=new Date();
int heure=madate.getHours();
int minute=madate.getMinutes();
int jour=madate.getDate();
i don't know how to get millisecondes...
jolyqr