Splits a date-time string into a date-time pair.

Type signature

(dateTimeString: string) => [string, string]

Examples

splitDateTime(
  "2019-01-15T13:54:33.232Z"
);
// ⇒ ["2019-01-15", "13:54:33.232Z"]
Try in REPL

Questions

  • How to split ISO-compliant date-time string into a date and time pair?

TypeScript sourceJavaScript source