to_j_duration

to_j_duration converts a time duration value to a Java Duration, which is a unit of time in terms of clock time (counting days, hours, minutes, seconds, and nanoseconds).

Important

In query strings, users should choose the built-in function parseDuration instead of to_j_duration. For more information, see:

Syntax

Parameters

ParameterTypeDescription
dtUnion[None, Duration, int, str, datetime.timedelta, numpy.timedelta64, pandas.Timedelta]

A date-time value to convert to a Java Duration.

Strings can be formatted according to the ISO-8601 standard, which is "[-]PTnHnMnS.nnnnnn", with n being numeric values; e.g., PT1H for one hour, PT1M for one minute, or -PT1M5.5S for negative one minute and 5.5 seconds.

Strings can also be formatted as "[-]PT00:00:00.000000".

Returns

Returns a Duration representation of the duration string.

Examples