{
  "category": "Date and time functions",
  "display_name": "TIMEVALUE",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.TIMEVALUE",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 6 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 6 recorded answers",
    "workbook_corpus": {
      "cells": 6,
      "matched": 6
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/dates.rs#L288-L294"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/text_format::read_value",
        "catalogue/text_format::profile",
        "catalogue/text_format::rendered",
        "catalogue/text_format::text",
        "decimal::low32",
        "decimal::Natural::zero",
        "decimal::Natural::from_u64",
        "decimal::Natural::pow10",
        "decimal::Natural::normalize",
        "decimal::Natural::is_zero",
        "decimal::Natural::mul_add_small",
        "decimal::Natural::times_pow10",
        "decimal::Natural::times_pow5",
        "decimal::Natural::times_pow2",
        "decimal::ExactDecimal::read",
        "decimal::ExactDecimal::binary",
        "format/datetime::has_invalid_exponent",
        "format/datetime::looks_like_datetime_format",
        "format/datetime::without_subseconds",
        "format/datetime::render_with_datetime_tokens",
        "format/datetime::tokenize_datetime_format",
        "format/datetime::elapsed_token_at",
        "format/datetime::classify_minute_tokens",
        "format/datetime::token_kind",
        "format/datetime::is_time_neighbor",
        "format/datetime::push_literal",
        "format/datetime::render_datetime_literal",
        "format/datetime::format_elapsed",
        "format/datetime::TimeParts::from_serial",
        "format::measured_host",
        "format::currency_literal",
        "format::digits",
        "format::fifteen",
        "format::split",
        "format::grouped",
        "format::general",
        "format::significant",
        "format::sections",
        "format::bracket",
        "format::is_condition",
        "format::is_elapsed",
        "format::condition_holds",
        "format::condition_of",
        "format::strip_tokens",
        "format::choose",
        "format::items",
        "format::numeric",
        "format::literal_text",
        "format::integer_part",
        "format::fraction_part",
        "format::scientific",
        "format::fraction_code",
        "format::FractionCode::render",
        "format::mixed_fraction_under_space_grouping",
        "format::convergent",
        "format::text_declared_date_locale",
        "format::text",
        "format::text_of_text",
        "format/names::month_name",
        "format/names::weekday_name",
        "format/names::locale_names",
        "locale::LocaleId::from_bcp47_language_tag",
        "locale::LocaleId::from_excel_lcid",
        "locale::short_date_order",
        "locale::short_date_pattern",
        "locale::currency_placement",
        "locale::currency_spacing",
        "locale::currency_negative_pattern",
        "locale::format_profile",
        "locale::days_from_civil",
        "locale::civil_from_days",
        "locale::ymd_from_excel_serial",
        "number_text::decimal",
        "number_text::first_precision",
        "number_text::near_tie",
        "number_text::first_rounding",
        "number_text::rounded",
        "number_text::increment",
        "number_text::ascii",
        "ported/date_kernels::days_from_civil",
        "ported/date_kernels::civil_from_days",
        "ported/date_kernels::serial_unbounded_1900",
        "ported/date_kernels::ymd_1900",
        "ported/date_kernels::is_leap",
        "ported/date_kernels::days_in_month",
        "ported/date_kernels::whole_serial",
        "ported/date_kernels::whole",
        "ported/date_kernels::weekday_sunday_one_based",
        "ported/date_kernels::remap_weekday",
        "ported/date_kernels::weekday_of",
        "ported/date_kernels::weekday",
        "ported/text_kernels::text",
        "ported/text_kernels::text_from_str",
        "ported/text_kernels::date_integer_floor",
        "ported/text_kernels::push_singleton_or_original",
        "ported/text_kernels::push_upper",
        "ported/text_kernels::upper",
        "value_text::measured_host_reader",
        "value_text::measured_space",
        "value_text::read",
        "value_text::number",
        "value_text::decimal",
        "value_text::fraction",
        "value_text::tokens",
        "value_text::month_named",
        "value_text::time_at",
        "value_text::full_year",
        "value_text::valid_day",
        "value_text::this_year",
        "value_text::serial_1900",
        "value_text::date_of",
        "value_text::date_time"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/dates.rs#L288-L294",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 6 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.TIMEVALUE.json",
  "name": "TIMEVALUE",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\n- **[DATEVALUE](FUNC.DATEVALUE.md)** — the mirror. `DATEVALUE(t) + TIMEVALUE(t)` is the standard\n  way to turn one timestamp string into one serial, and it works precisely because each function\n  discards what the other keeps.\n- **[TIME](FUNC.TIME.md)** — the deterministic, locale-free alternative when the components are\n  already numbers. Prefer it wherever the input is not literally text.\n- **[HOUR](FUNC.HOUR.md), [MINUTE](FUNC.MINUTE.md), [SECOND](FUNC.SECOND.md)** — the decomposition\n  applied to whatever `TIMEVALUE` produces; a natural round-trip test.\n- **The `VALUE` function** — the general text-to-number conversion, whose accepted set overlaps this\n  one in ways the documentation does not describe.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n1. **Locale is an input.** A parser with a hard-coded `HH:MM:SS` grammar implements one\n   configuration of this function, not the function.\n2. **Decide, and document, the ≥24-hour policy.** The `TIME` constructor's documented modulo rule\n   is a tempting default, but `TIMEVALUE` is a parser and parsers usually reject rather than wrap.\n   Neither behaviour can be claimed as Excel's without observation.\n3. **Preserve the discard rule exactly.** Parsing a full timestamp and returning `frac` of the whole\n   serial is *not* the same as parsing the time part, once the date part is out of range or\n   ambiguous.\n4. **Do not claim compatibility from an inferred grammar.** State the forms accepted; do not state\n   that they are the forms Excel accepts.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns a `Number` in [0, 1).\n\n- **Any date part is discarded**, so a full timestamp string yields only its time.\n- **Values at or above 24 hours** have no representation in the result's range. Whether\n  `TIMEVALUE(\"25:00\")` errors, wraps to 01:00 (as [TIME](FUNC.TIME.md)'s documented modulo rule\n  would), or is simply not accepted by the parser is **not documented and not checked here**. It is\n  the most interesting open question about this function, because the two plausible answers come\n  from two different parts of the system: the parser's grammar and the constructor's arithmetic.\n- **Fractional seconds** — whether `\"12:00:00.5\"` parses, and whether the fraction survives, is\n  undocumented and unverified.\n- **Whitespace, AM/PM spelling and separators** are part of the same undocumented, locale-scoped\n  accepted set that `DATEVALUE` has.\n\n\n\n### Errors\n\n\nAs documented:\n\n- `#VALUE!` when `time_text` does not represent a valid time.\n\nAn error value passed in propagates in the ordinary way. Nothing here overrides the engine rules in\n[coercion and lifting](../model/02-coercion-and-lifting.md).\n\n\n",
    "sources": "\n- Microsoft 365 support, **TIMEVALUE function** —\n  <https://support.microsoft.com/en-us/office/timevalue-function-0b615c12-33d8-4431-bf3d-f3eb6d186645>.\n- Microsoft 365 support, **DATEVALUE function** —\n  <https://support.microsoft.com/en-us/office/datevalue-function-df8b07d4-7761-4a93-bc33-b7471bbff252>.\n  Source of the mirror-image documented rules referred to above.\n- [FUNC.TIME](FUNC.TIME.md) — the constructor, its documented range and its modulo rule.\n- Handbook call-model chapter [02 coercion and lifting](../model/02-coercion-and-lifting.md).\n- `data/functions/FUNC.TIMEVALUE.json`, `data/presence/FUNC.TIMEVALUE.json`,\n  `data/battery/FUNC.TIMEVALUE.json`.\n\n",
    "version-differences": "No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.",
    "what-it-does": "\n`TIMEVALUE` converts text that reads as a time into the fraction of a day it denotes — the same\nkind of value [TIME](FUNC.TIME.md) constructs from three numbers, and the fractional counterpart to\nwhat [DATEVALUE](FUNC.DATEVALUE.md) produces from date text.\n\nIt is the exact mirror of `DATEVALUE`: where `DATEVALUE` parses the date part of a string and\ndiscards any time, `TIMEVALUE` parses the time part and discards any date. `TIMEVALUE(\"1/1/2024\n13:00\")` is 13:00 as a fraction, with the date thrown away.\n\nThe result is therefore always in [0, 1), and the caveats about representability on\n[TIME](FUNC.TIME.md) apply unchanged: 1/86400 is not exactly representable, so a parsed time is\ngenerally a nearby double rather than the exact value.\n\n\n### Arguments\n\n\n`TIMEVALUE(time_text)` — one required argument.\n\n**time_text** — text representing a time, or a reference to a cell containing such text. The\ndocumented examples are of the `\"6:45 PM\"` and `\"18:45\"` shape.\n\nThe misunderstood case is the same one `DATEVALUE` has: passing a cell that already holds a real\ntime. A cell holding a time holds a number, and this function exists for text that Excel did *not*\nconvert on entry — typically imported or concatenated data.\n\n\n"
  },
  "signature": {
    "display": "TIMEVALUE(time_text)",
    "parameters": [
      {
        "description": null,
        "name": "time_text",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Date and time functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "LocaleProfile",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "Composite",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Time serial read from a time written as text",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Converts a time in the form of text to a serial number",
        "microsoft_url": "https://support.microsoft.com/en-us/office/timevalue-function-0b615c12-33d8-4431-bf3d-f3eb6d186645"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "TIMEVALUE"
        },
        {
          "locale": "bg-BG",
          "name": "TIMEVALUE"
        },
        {
          "locale": "cs-CZ",
          "name": "ČASHODN"
        },
        {
          "locale": "da-DK",
          "name": "TIDSVÆRDI"
        },
        {
          "locale": "de-DE",
          "name": "ZEITWERT"
        },
        {
          "locale": "el-GR",
          "name": "TIMEVALUE"
        },
        {
          "locale": "en-AU",
          "name": "TIMEVALUE"
        },
        {
          "locale": "en-GB",
          "name": "TIMEVALUE"
        },
        {
          "locale": "en-US",
          "name": "TIMEVALUE"
        },
        {
          "locale": "es-ES",
          "name": "HORANUMERO"
        },
        {
          "locale": "et-EE",
          "name": "TIMEVALUE"
        },
        {
          "locale": "fi-FI",
          "name": "AIKA_ARVO"
        },
        {
          "locale": "fr-FR",
          "name": "TEMPSVAL"
        },
        {
          "locale": "he-IL",
          "name": "TIMEVALUE"
        },
        {
          "locale": "hr-HR",
          "name": "TIMEVALUE"
        },
        {
          "locale": "hu-HU",
          "name": "IDŐÉRTÉK"
        },
        {
          "locale": "id-ID",
          "name": "TIMEVALUE"
        },
        {
          "locale": "it-IT",
          "name": "ORARIO.VALORE"
        },
        {
          "locale": "ja-JP",
          "name": "TIMEVALUE"
        },
        {
          "locale": "ko-KR",
          "name": "TIMEVALUE"
        },
        {
          "locale": "lt-LT",
          "name": "TIMEVALUE"
        },
        {
          "locale": "lv-LV",
          "name": "TIMEVALUE"
        },
        {
          "locale": "nb-NO",
          "name": "TIDSVERDI"
        },
        {
          "locale": "nl-NL",
          "name": "TIJDWAARDE"
        },
        {
          "locale": "pl-PL",
          "name": "CZAS.WARTOŚĆ"
        },
        {
          "locale": "pt-BR",
          "name": "VALOR.TEMPO"
        },
        {
          "locale": "pt-PT",
          "name": "VALOR.TEMPO"
        },
        {
          "locale": "ro-RO",
          "name": "TIMEVALUE"
        },
        {
          "locale": "ru-RU",
          "name": "ВРЕМЗНАЧ"
        },
        {
          "locale": "sk-SK",
          "name": "TIMEVALUE"
        },
        {
          "locale": "sl-SI",
          "name": "TIMEVALUE"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "TIMEVALUE"
        },
        {
          "locale": "sv-SE",
          "name": "TIDVÄRDE"
        },
        {
          "locale": "th-TH",
          "name": "TIMEVALUE"
        },
        {
          "locale": "tr-TR",
          "name": "ZAMANSAYISI"
        },
        {
          "locale": "uk-UA",
          "name": "TIMEVALUE"
        },
        {
          "locale": "vi-VN",
          "name": "Hàm TIMEVALUE"
        },
        {
          "locale": "zh-CN",
          "name": "TIMEVALUE"
        },
        {
          "locale": "zh-HK",
          "name": "TIMEVALUE"
        },
        {
          "locale": "zh-TW",
          "name": "TIMEVALUE"
        }
      ],
      "signature": {
        "display": "TIMEVALUE(time_text)",
        "parameters": [
          {
            "description": null,
            "name": "time_text",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "TIMEVALUE",
      "version_marker": null,
      "xlcall": {
        "code": "141",
        "symbol": "xlfTimevalue"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/timevalue-function-0b615c12-33d8-4431-bf3d-f3eb6d186645"
  },
  "try_it": {
    "formula": "=TIMEVALUE(\"12:34:56\")"
  },
  "url": "https://handbook.dnacalc.com/functions/TIMEVALUE.html",
  "variants": [],
  "versions": []
}