on 11-20-2008 6:23 AM
Hi Gurus,
could anyone tel me ,
e.g:20.11.2008:11:23:54am
How to convert Time stamp into exact Date and Time
Hi,
Following is one way of doing it
Timestamp timeStamp = new Timestamp(Calendar.getInstance().getTimeInMillis());
System.out.println(timeStamp);
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
System.out.println(dateFormat.format(timeStamp));
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
System.out.println(timeFormat.format(timeStamp));
Output
2008-11-20 11:59:35.693 -> Timestamp
11/20/2008
11:59:35
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.