Select the text fields, hopefully they are in a column or columns.
After selecting the fields select "Data > Text to Columns..." from
the menu
In the Text to Columns dialog box select the following options:
For "Separator Options" tick "Separated by".
The only separator option that should be ticked is "Space".
Be certain "Detect special numbers" is ticked in the "Other Options"
choices.
Click the "OK" button.
The time portion of the column will now be a time formatted number in
the
column it was already in. Depending on the default format it may or
may not
have AM/PM. If it doesn't, just change the time format to what you
need at
this point.
The "a.m." or "p.m." portion of your original text will be moved one
column
over. It will overwrite what is in the next column if the column is not
empty.
To prevent adjacent columns from being overwritten, while still in the
"Text to Columns" dialog box, go to the "Fields" section at the bottom.
There should be two columns with a heading of "Standard", one column
showing the time portion of your text, the other column showing the
a.m/p.m
portion. Click the word "Standard" over the a.m/p.m column.
Now open the "Column type" list and pick the "Hide" option.
Finally, click OK to close the dialog box.
You text time will now be a time number in the column it was already in.
The a.m/p.m portion has not overwritten the adjacent column as it has
been
discarded as part of the Text to Columns operation.
On Wed, Jun 28, 2023 at 4:32 PM James <bjlockie@lockie.ca> wrote:
I have text fields like:
10:06:59 a.m.
8:57:36 p.m.
How do I convert them to 24-hour time fields?
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems?
https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more:
https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy