Convert API Time Text to Local Time in Excel and Display 2 PM
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.

- 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.
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.
Convert time text with TIMEVALUE and apply a 12-hour format
Use this when the extracted time is already in the intended time zone.
If cell A2 contains 14:00 as text, enter =TIMEVALUE(A2) in an empty cell and press Enter.
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.
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.

Adjust a UTC time to a local offset
Use this when the extracted time is in UTC and you know the applicable local offset in hours.
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. Open your spreadsheet: Open WPS Spreadsheets and use Open to select the file containing the extracted API time text.
- 2. Convert the time: If A2 contains 14:00 as text, enter =TIMEVALUE(A2) in an empty cell and press Enter.
- 3. Apply the display format: Select the result, open Format Cells, and choose Number > Custom. Enter h AM/PM and confirm the format.
- 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.

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.




