how to set current date in timestamp attribute in Java Plain API
One answer
A timestamp Attribute, if you look at the API e.g. IWorkItem.setDueDate() id of type java.sql.Timestamp.
You can use the PDE to look at that type, you can search in search engines how it is used. It boils down to
where Date is java.util.Date. There are a few constructors not deprecated, that you can use.
You can use the PDE to look at that type, you can search in search engines how it is used. It boils down to
Timestamp ts=new Timestamp(new Date().getTime()); target.setDueDate(ts);
where Date is java.util.Date. There are a few constructors not deprecated, that you can use.
Comments
Thanks for your advice.
I search for the SDK. I used the following code. It's ok.
//set now to date long now= System.currentTimeMillis();By the way, what is the PDE? Could you kindly tell me?How to use it?
IAttribute targetdate= workItemCommon.findAttribute(newState.getProjectArea(), "updatedate", monitor);
newState.setValue(targetdate, new Timestamp(now));
PDE is the Eclipse Plugin Development Environment. How to use it with the SDK is described here:
https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/
https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/