cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert Timestamp into exact Date and Time(FM)

Former Member
0 Kudos
97

Hi Gurus,

could anyone tel me ,

e.g:20.11.2008:11:23:54am

How to convert Time stamp into exact Date and Time

View Entire Topic
Former Member
0 Kudos

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

Former Member
0 Kudos

How to write this into ABAP Code

Former Member
0 Kudos

Use FM CONVERT_INTO_TIMESTAMP or check any FM converttimestamp*.

Regards

Snehasish

Edited by: Snehasish Das on Nov 20, 2008 1:37 PM

Former Member
0 Kudos

close thread

Thanq all