to_j_period

to_j_period converts a date-time value into a Java Period, which is a length of time expressed as PnYnMnWnD, with n being numeric values for years, months, weeks, and days.

Important

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

Syntax

Parameters

ParameterTypeDescription
sstr

A Python period or period string.

Period strings should be in the form of PnYnMnWnD, with n being numeric values; e.g., P1W for one week, P1M for one month, or P1W5D for one week plus five days.

Returns

Returns a Java Period.

Examples