Skip to main content

parseTime

Caution
  • Please use the parseTimeAsTimeValue from @dynatrace-sdk/units instead.

You can use the parseTime utility function to convert a string into TimeDetails, giving you a normalized version of the input string (trimmed string), a Date object created from the given input, and the type of input. The type can be either an expression or iso8601 string. If it is not possible to convert the input, the function will return null.

Import

import { parseTime } from '@dynatrace/strato-components-preview/core';

Use cases

CodeSandbox
Still have questions?
Find answers in the Dynatrace Community