cancel
Showing results for 
Search instead for 
Did you mean: 

Convert java.sql.Timestamp to CctDateTime object

Former Member
0 Kudos

Hi Experts,

I want to convert java.sql.Timestamp object to com.sap.dictionary.runtime.container.CctDateTime object. I wrote the following code:

CctCode timeZoneCode = new CctCode("CET", null,null,null,null,null);

Timestamp timeStamp = Timestamp.valueOf("2007-01-01 08:00:00.000");

CctDateTime dateTime = new CctDateTime(timeStamp, timeZoneCode, false);

But the above constructor CctDateTime is deprecated.Is there any other way to convert timestamp object to CctDateTime object?

Note: I am working on Netweaver CE

Thanks,

Monideepa

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Monideepa,

Try this. I changed boolean value false to Boolean Object with value false.


CctCode timeZoneCode = new CctCode("CET", null,null,null,null,null);
Timestamp timeStamp = Timestamp.valueOf("2007-01-01 08:00:00.000");
Boolean bool = new Boolean(false);
CctDateTime dateTime = new CctDateTime(timeStamp, timeZoneCode, bool);

This works fine.

Deprecated methods or constructors still work anyway but it is a good practice to use suggested alternatives.

Vishwas.