TTimeEdit time format hh:mm:ss and hh:mm lazarus / 31-LCL ---------------------------------------------------------------------- Vodnik · 2019-01-22 14:30 I used TDateTimePicker with success, but users prefer separate fields for date and time TTimeEdit shows time as HH:MM. I have several time fields, in some I have to show time as HH:MM, in others - as HH:MM:SS (duration). Is it possible to do this with TTimeEdit? ---------------------------------------------------------------------- howardpc · 2019-01-22 15:00 I can see no simple way to get what you want, since SetTime - the method which controls the time display - is private (not protected) and is not declared as virtual. In other words the control has not been designed to be readily subclassed to extend its functionality. However, it would be straightforward to write a replacement that offered either long or short time format as a property which defaulted, say, to the short format. The attached project shows one way to adapt the LCL component. It is just a copy and paste from the sources with a few alterations. I hope someone may be able to show us a better way to adapt the LCL component than by duplicating 95% of the existing code, but I don't myself know how else to do it. ---------------------------------------------------------------------- Vodnik · 2019-01-22 20:21 Thank you, howardpc! I didn't expect that a new component is needed for this. Specific application may also require to show/edit time intervals including milliseconds, then more adaptation should be done. Your project works fine, of course, but in my 1.8.4 I had to comment out: //    property Images; //    property ImageIndex; //    property ImageWidth; Going beyond the true path, I thought about: - come back to TDateTimePicker: one for Date, one for Time, one for Duration - using TMaskEdit ---------------------------------------------------------------------- Zoran · 2019-01-25 14:04 Quote from: Vodnik on January 22, 2019, 09:21:24 pmThank you, howardpc! I didn't expect that a new component is needed for this. Specific application may also require to show/edit time intervals including milliseconds, then more adaptation should be done. Your project works fine, of course, but in my 1.8.4 I had to comment out: //    property Images; //    property ImageIndex; //    property ImageWidth; Going beyond the true path, I thought about: - come back to TDateTimePicker: one for Date, one for Time, one for Duration - using TMaskEdit Simply use two DateTimePickers. In the first set Kind property to dtkDate. In the other set Kind to dtkTime and use TimeDisplay property to adjust which time parts should be shown. ---------------------------------------------------------------------- Bart · 2019-01-25 14:24 The TTimeEdit was not designed for hh:mm:ss format. It is a simple control to just pick a time (which is rather obvious from it's default behaviour). A TDateTimePicker would be more suitable for your needs. Bart