Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360056

Summary: strLib.formatTimestamp doesn't work when format is in variable declaration
Product: z_Archived Reporter: broy2
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description broy2 CLA 2011-10-05 19:48:11 EDT
RBD writes:
ts1 = 2011-10-05 19:46:01
ts2 = 2011-10-05 19:46:01.109000
ts3 = 2011-10-05
ts4 = 10-05 19:46:01.10
ts4 with format = October 05, 2011  at  07:46 PM

EDT writes:
ts1 = 2011-10-05 19:36:51.562000
ts2 = 
ts3 = 
ts4 = 
ts4 with format = October 05, 2011  at  07:36 PM

program formatTimeStamp type BasicProgram{}
    ts1 timeStamp;
    ts2 timeStamp("yyyyMMddHHmmssffffff");
    ts3 timeStamp("yyyyMMdd");
    ts4 timeStamp("MMddHHmmssff");
    tsString string;
    myFormat string = "MMMMMMMMM dd, yyyy ' at ' hh:mm aa";
    function main()
        tsString = ts1; 
        SysLib.writeStdout("ts1 = " + tsString);
        tsString = strLib.formatTimestamp(ts2);
        SysLib.writeStdout("ts2 = " + tsString);
        tsString = strLib.formatTimestamp(ts3);
        SysLib.writeStdout("ts3 = " + tsString);
        tsString = strLib.formatTimestamp(ts4);
        SysLib.writeStdout("ts4 = " + tsString);
        tsString = strLib.formatTimestamp(ts4,myFormat);
        SysLib.writeStdout("ts4 with format = " + tsString);
    end
end
Comment 1 Jeff Douglas CLA 2011-10-21 09:48:47 EDT
This defect will become invalid once the agree-upon changes are made to EDT. The changes are that the default formats will disappear and that will also cause the format functions that don't specify a default as an arg, will become invalid.
Comment 2 broy2 CLA 2011-10-31 11:49:57 EDT
OK