Dear experts,
From sap perspective if i use function module CONVERT_INTO_TIMESTAMP on my PI box,
for CET (germany),i get following timestamp.I need to do as alternate in java.Exhausted using various classes but
could not achieve this timestamp.
Date Timestamp
05.08.2010 should be 20.100.804.220.000
Plz suggest how to get this ?
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
public class DateConvert
{
public static void main (String args[])
{
String startTime = new String("05.08.2010");
DateFormat formatter = new SimpleDateFormat("dd.mm.yyyy");
try {
Date d = formatter.parse(startTime);
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.println(sdf.format(d));
Date ds = new Date(sdf.format(d));
System.out.println(ds.getTime());
}
catch(Exception gh)
{
gh.printStackTrace();
}
}
}
Edited by: Adi1000 on Aug 5, 2010 11:28 PM
Edited by: Adi1000 on Aug 5, 2010 11:54 PM