Macro Question - Get 12 Hour Clock not 24 Hour

Another Macro Question, part of the macro

Format( .Hours, “0#” ) & “:” & _
Format( .Minutes, “0#” )

Give the time in military time instead of 12 hour. I tried setting the format but that has no affect. I assume the 0# needs to be something else, but I cannot find the right search terms to find this function to look it up myself.

https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03120301.html

Found another function here that works so I will mark this as closed.

Thanks but I found nothing on that link that showed me time settings.

What function is that?

A format string like H:MM AM/PM will do that.

Of course, the “question” doesn’t tell what .Hours or .Minutes are; indeed, it is most likely just some integers, and not the proper times. The format code above would only work with proper times, like

  Format(Time(), "HH:MM AM/PM")

tdf#157603