Cell display format is HHMM Entering time in that format e.g. 0430, displays 0000 and the edit cell data is 10320:00:00 I have to enter 04:30 to display 0430 number format should accept data in that format If the format were MMSS entering 0090 should display 0130
If you introduce a value such as 04:30 in a cell that is formatted as General/Standard, Calc should recognize the value as a Time format. A value such as 0430 (without the colon character) is not automatically recognized as a Time type of value. So the result, as a General type is 430, which is an integer number. Converting an integer number to Time format means "12:00:00 AM". n.0 > 12:00 AM n.25 > 06:00 AM n.50 > 12:00 PM n.75 > 06:00 PM So, 0.1875 (the so-called "date-time serial value") would be displayed as 4:30 AM when formatting the cell as Time format. That is for Time format. Then you have also Time Differences. There are several Date/Time-related functions that could be useful too. I would suggest searching the Help content. IMO, NAB.
I already knew all that. I wrote software for decades and if the use chose a VALID display format, that format was recognized as input. It's a PITA to have to remember to add a colon for military time when every other item in the column is 0000 format. 1234 is VALID time format Setting a date format mmm-dd-yyyy formats correctly for 4/15/51,4-15-51, April 14, 1951, etc. Consistency is key!
(In reply to Ian Eales from comment #2) > I already knew all that. Great. Please don't assume that (other) volunteers know everything. To be clear (at least for other readers), the problem is with the introduction (and "automatic" recognition) of the (integer) values; not the resulting presentation. You could still solve this by using functions such as TIME, LEFT, MID, LEN, and using the Time format that you want. Let's see if a developer has an idea of how to automatically discern the military Time pattern from any common integer when introducing values.
(In reply to Ian Eales from comment #2) > Setting a date format mmm-dd-yyyy formats correctly for 4/15/51,4-15-51, > April 14, 1951, etc. FWIW, the Date format can be set in whichever way you want, but the automatic recognition of a value as a Date depends not on the cell's format but on menu Tools > Options > Languages > General > (Formats) Date acceptance patterns. These 2 items can be different, so you should not expect automatic recognition of Date patterns according to the cell's (display) format but according the aforementioned Options setting.
I'm entering the data manually. Importing is no issue as I can format as needed. There is no TIME format option in Tools... I checked before I wrote. If a column is a TIME 0000 format, it does recognize the decimal point part of a DateTime. However, I'm not clever enough to do the math for 0413 However Date, Time and DateTime are three separate entities. TIME formatted cells should understand Time in the field format.
(In reply to Ian Eales from comment #5) > I'm entering the data manually. Importing is no issue as I can format as > needed. Where is "importing" mentioned? Now I'm confused. > > There is no TIME format option in Tools... I checked before I wrote. Correct. That's why I did not point to it when talking about Time formats. OTOH, in comment 2 you seemed to imply that whichever Date format is set for the cell, the introduction in such format would be automatically recognized. In comment 4 I clarified that such assumption is not accurate. I have not tested whether changing the Date pattern recognition to use a Time-only format (that would be unique and not potentially parsed as any Date format) would work. > > If a column is a TIME 0000 format, it does recognize the decimal point part > of a DateTime. However, I'm not clever enough to do the math for 0413 > > However Date, Time and DateTime are three separate entities. TIME formatted > cells should understand Time in the field format. Simple alternative example A1: 0430 Column A is the "value introduction column"; typing-in the initial zero is optional; the column can be formatted as 0000, not as Time. B1: =RIGHT(A1;2) (this column could be set as hidden later-on) C1: =LEFT(A1;LEN(A1)-2) (this column could be set as hidden later-on) D1: =TIME(C1;B1;) Column D could be formatted with any time format you want, including HHMM. All this should had been part of <https://ask.libreoffice.org>, leaving this site for bug reports and enhancement requests.
I'd like to make clear that the alternative I mentioned in comment 6 is not "perfect". It would need further development for some corner cases (e.g. 00:01 AM), and it could be simplified to use only 1 auxiliary column instead of 3. The point is that some simple formulas could solve the problem.
Formulas are not an option as I am entering the data from the keyboard. AND When a cell with 0430 is edited, it shows 04:30:00 AM making it tedious to edit. I either have to backspace off the :00 AM or mouse/arrow into the data. Both are more work than necessary
At most a request for enhancement, but certainly not a bug. BTW the same issue could be to introduce dates. And what if you need to enter a number that is right as number / date / time with those four digits?. And maybe other issues, no easy to anticipate. And to enter 0400 you can use 4: two keystrokes. I know in several keyboards. It is a shift key, but also you can modify some key on the keyboard to have it without shift. OTOH, 'Date acceptance pattern' doesn't accept 'DDMM' as such, always needs the separator.