The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/docs/sources/packages_api/data/datetimeparse.md

1.2 KiB

+++

-----------------------------------------------------------------------

Do not edit this file. It is automatically generated by API Documenter.

-----------------------------------------------------------------------

title = "dateTimeParse" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" +++

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. Examples on UTC-based values are Unix epoch and ISO formatted strings.

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';