Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Export Date not Timestamp when exporting using RPE

I have fields in RQM where I am assigning a Date to a Test Case and when I export to RPE I want to display only the date - preferably in a UK style format dd/mm/yyyy.

However in RPE it always displays the a timestamp as well as the date in us format yy/mm/dd.

Is there a way to change this without having to use Java Script to parse and split the string up before re-assembling with just the informaiton I am interested in exporting.


0 votes



One answer

Permanent link
If you are printing the date (dateTime) in a Text element, set Date pattern (in Properties->Specific tab for the Text element) property.
As an alternate, you can use a JavaScript function to change the date format. These functions can be readily found in .js files under %rpe_home%\utils\scripts, if you are using RPE 2.1 or later. Here is a sample function:
//function to change date format to "MMM dd, yyyy"
function changeDateFormat(date)
{
    try
    {
        var currDtFmt = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    var curDt = currDtFmt.parse(date);
    var expDtFmt = new java.text.SimpleDateFormat("MMM dd, yyyy");
    var dateString = expDtFmt.format(curDt).toString()
    _sessionLogger.info("##### data string: " + dateString);
    return dateString;
    }
    catch(err)
    {
        java.lang.System.out.print( err);
    return date;
    }
}

0 votes

Comments

Propoerties changes doesn't work. (I suspect because I have to grab the value, assign it to a variable and then print the variable.)

I'm working with RPE 1.3 - and there's nothing in the utils folder. Is there somewhere else I can find these javascript functions?

I ran a quick test and just setting Date format to yyyy-MM-dd works fine.




However, setting it to yyyy-MM-dd returned incorrect date.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019
× 332

Question asked: Nov 09 '16, 9:17 a.m.

Question was seen: 4,067 times

Last updated: Nov 10 '16, 12:23 p.m.

Confirmation Cancel Confirm