Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360056 - strLib.formatTimestamp doesn't work when format is in variable declaration
Summary: strLib.formatTimestamp doesn't work when format is in variable declaration
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-05 19:48 EDT by broy2 CLA
Modified: 2017-02-23 14:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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