cbpporter Messages: 1427 Registered: September 2007
Ultimate Contributor
The format method is "const". This means that it is not supposed to modify the state of the object. In consequence you can't modify fields or call other methods that are not labeled as const.
Normally you would solve this by making the offending method const, but in your case we are talking about a setter method which by definition can't and shouldn't be const.
I suppose you wanted to call setTime for testing purposes? You should do this in the constructor for an easy temporary test. The Format method should not modify the state of the object. Format is a functional method, not a side effect one.