Military time (24-hour clock)

Hello all, Is there an easy way to have Navision display a time field in military time format, also known as the 24 hour clock, regardless of the system setting? So instead of 2:00:00 PM, I want to see 14:00:00. Thanks, Daniel

Try this… MESSAGE(’%1’,FORMAT(TIME,8, ‘<Hours24,2>:<Minutes,2>:<Seconds,2>’));

I know about how to accomplish this in C/AL and on forms using the format property. I’d like to know if there is a way to do this on the table, so I don’t have to change all the forms that displays the field.

I don’t think it possible to change it “in the tables”. And if it was possible, you don’t want to do it! The time in Navision is stored in a “Navision way”, and is displayed according to the regional settings of your client. For example, in WinXP, if you want to a 24 hours display, change the regional time settings to HH:mm:ss (H in caps means 24 hours). If you need a fixed format for development purposes (ex: include date & time in the name of an export file), use the FORMAT function.

David, Do you know if displaying time in a different format on the form causes errors in storing it back to the database? This may be a reason for my customer to decide against changing the display. I think they need it for uneditable fields only, but of course they may want to expand on it later. BTW, we’re not using it for filenames, then I’d have used the FORMAT expression. They want to use it for display purposes only. So there is a time field in one of the tables that they want to see in military format, but they don’t want to have to change the regional settings just for these few fields. All other applications must still be in AM/PM format. Thanks, Daniel.

Daniel there is no problem, you will be able to enter the times in European format, as well as displaying them that way. Just add the format command suggested by David onto the property.