Data Import & Export

Convert API Time Text to Local Time in Excel and Display 2 PM

Jason MillerJason Miller Dec 2, 2026 868 views

Question details

Convert a time extracted from an API timestamp into an Excel time value that can be displayed as 2 PM in cells and charts.

Convert API Time Text to Local Time in Excel and Display 2 PM
Product
Microsoft Excel
Device & OS
not provided
Scenario
An API supplies a timestamp, and the user needs to convert its time text and display it in a local, 12-hour format.
Observed behavior
The desired result is a numeric time value that can be formatted as 2 PM and used in charts.
Before you start

Check whether the API time is already local or is supplied in UTC or another time zone. Identify the cell containing the extracted time text, such as 14:00, and determine the correct local offset if conversion is needed.

Solution 1Recommended

Convert time text with TIMEVALUE and apply a 12-hour format

Use this when the extracted time is already in the intended time zone.

1
Convert the text

If cell A2 contains 14:00 as text, enter =TIMEVALUE(A2) in an empty cell and press Enter.

2
Format the result

Select the result cell, open Format Cells, and choose Number > Custom. Enter h AM/PM as the format and select OK to display 14:00 as 2 PM.

3
Use the value in a chart

Select the converted time values when creating or updating the chart. If a time value axis needs formatting, right-click the axis, choose Format Axis, and apply the custom number format h AM/PM.

Convert time text with TIMEVALUE and apply a 12-hour format
Time zones are separate: TIMEVALUE converts text to a numeric time; it does not change the time zone. Apply the appropriate offset first if the API time is not already local.
Convert API times in WPS Spreadsheets

Display API time values in WPS Spreadsheets

Use TIMEVALUE in WPS Spreadsheets to turn extracted time text into a numeric value, then apply a custom 12-hour format for cells and charts.

  1. 1. Open your spreadsheet: Open WPS Spreadsheets and use Open to select the file containing the extracted API time text.
  2. 2. Convert the time: If A2 contains 14:00 as text, enter =TIMEVALUE(A2) in an empty cell and press Enter.
  3. 3. Apply the display format: Select the result, open Format Cells, and choose Number > Custom. Enter h AM/PM and confirm the format.
  4. 4. Create a chart: Select the converted values and use Insert > Chart to add a chart. Format a time value axis with h AM/PM if needed.
Convert API time text into usable spreadsheet time valuesDisplay times in a readable format such as 2 PMOpen and edit Microsoft Excel XLSX and XLS filesCreate charts from converted time values
microsoft office alternative - wps office

Frequently Asked Questions

Why does the converted time appear as a decimal?

Excel stores times as fractions of a day. Select the formula cell, open Format Cells > Number > Custom, and enter h AM/PM to display the value as a time.

Does TIMEVALUE automatically convert UTC to my local time zone?

No. TIMEVALUE converts time text to a numeric value without changing its time zone. For a UTC time in A2 and the applicable local offset in hours in B2, use =MOD(TIMEVALUE(A2)+B2/24,1).

How can I extract the time from a complete API timestamp?

If A2 contains an ISO-style timestamp such as 2025-01-01T14:00:00Z, use =TIMEVALUE(MID(A2,12,5)) to convert the extracted 14:00. This does not adjust the UTC time to a local time zone.

How do I show 2 PM on an Excel chart axis?

Use the converted numeric time values in the chart. Right-click the time value axis, select Format Axis, and set its number format to h AM/PM.