Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/grafana/v8.0/packages_api/data/datetimeparse.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/grafana/v8.0/packages_api/data/datetimeparse/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
dateTimeParse variable
dateTimeParse variable
Helper function to parse a number, text or Date to a DateTime value. If a timeZone is supplied the incoming value is parsed with that timeZone as a base. The only exception to this is if the passed value is in a UTC-based format. Then it will use UTC as the base. If no format is specified the current system format will be assumed.
It can also parse the Grafana quick date and time format, e.g. now-6h will be parsed as Date.now() - 6 hours and returned as a valid DateTime value.
If no options are supplied, then default values are used. For more details please see DateTimeOptions.
Signature
dateTimeParse: DateTimeParser<DateTimeOptionsWhenParsing>Import
import { dateTimeParse } from '@grafana/data';