datetime - How to get Timestamp with AM/PM in java -


i have date string , needs converted in time stamp am/pm . tried below way, i'm getting proper date format didn't in am/pm.

can 1 please ?

code snippet:

string datestring = "10/10/2010 11:23:29 am";  simpledateformat sfdate = new simpledateformat("mm/dd/yyy hh:mm:ss a");     date date = new date();     date = sfdate.parse(datestring);     system.out.println(new timestamp(date.gettime())); 

which gives me output below :

2010-10-10 11:23:29.0 

but needs

2010-10-10 11:23:29.00000000 

kindly me please.

why create timestamp ? when can :

            simpledateformat sfdate = new simpledateformat("mm/dd/yyy hh:mm:ss a");             date date = new date();             date = sfdate.parse(datestring);             system.out.println(sfdate.format(date) ); 

output:

10/10/10 11:23:29 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -