Java new date() with milliseconds -



Java new date() with milliseconds -

i got this:

simpledateformat sdfdate = new simpledateformat("yyyy-mm-dd hh:mm:ss.sss"); date info = new date();

how can "data" variable in "sdfdate" format?

i need output (it must current time):

2014-11-10 17:48:20.128

you should do:

sdfdate.format(data);

this right way utilize dateformatter format given date.

ex.

system.out.println("date: " + sdfdate.format(data));

java

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -