CTimeStamp and convertIntoDisplayString

Hi there,

I need to convert a CTimeStamp to displayable String.
I found this method convertIntoDisplayString but the problem is,
that it expects two input strings:
(java.lang.String dateFormat, java.lang.String timeFormat)

Converts this timestamp into a string according the given date and time format. All available formats are defined in class SessionContext. You can find the current session format via SessionContext.getDateDisplay() and SessionContext.getTimeDisplay().

The problem is, that the class I want to use this date conversion does not have Visability to the SessionContext!
Are there some constants for input?

Thanks!

Hi Konstantin,

please use SessionContext.* constants…

Bjoern

But I am not inside an Adapter!!!
I am outside…

I would like to use the default DateDisplay Format and not one,
that I define by myself. For example, with this method,
if someone uses my software in the states, the date format is not ok.

public String getCreationTimeString() {

	CTimeStamp creationTime;		
	creationTime = new CTimeStamp(mWorkItem.getCreationTime());
	String dateDisplayFormat = com.softwareag.cis.context.SessionContext.DATE_DDPMMPYYYY;
	String timeDisplayFormat = com.softwareag.cis.context.SessionContext.TIME_HHCMMCSS;
	return 
		creationTime.convertIntoDisplayString(dateDisplayFormat,timeDisplayFormat);
				
}

Hi Konstantin,

well, we only can make the information available in Adapter objects, these are the ones we control. Using the information in other objects (that are not adapter related) means you have to somehow carry the information about the adapter context to this object.

Bjoern