Skip to main content

parseTime

Caution
  • please use _parseTime from this package or the parseTime (@dynatrace-sdk/units/util-format/time) from the sdk 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