Duration formats supported in Zoho DataPrep

Duration formats supported in Zoho DataPrep

Duration is the difference between two time values. A duration format can be formed using different format strings such as D, H, SSSSSS, etc.  

Zoho DataPrep supports the following format strings:

Format String

Description

Range

D

Indicates the Days

0 to 36500000

H

Indicates the Hours 

00 to 23

Note: The range for duration in hours is 0 to 876000000

m

Indicates the Minutes

00 to 59

s

Indicates the Seconds

00 to 59

Note: The range for duration in seconds is 0 to 3153600000000

SSS

Indicates the Milliseconds

00 to 999

SSSSSS

Indicates the Microseconds

0 to 999999


You can also construct your own duration formats using the formats strings and delimiters. You can select a predefined format, choose to modify it, or create formats in the Change duration format, and Change data type transforms. You can use the % symbol to separate the format strings.

For example, %D.%H:%m:%s.%SSSSSS where %D is number of days, %H is number of hours, %m is number of minutes, %s is number of seconds, and %SSSSSS is number of microseconds. You can add any literals and delimiters in the duration formats. For example, in the duration, 201 jours 11.12.21, the days literal is used in French and a dot(.) is used as a delimiter.



Supported duration formats

Zoho DataPrep supports a wide range of duration formats. Here are a few examples of the supported duration formats in DataPrep.

Duration only

Formats

Examples

%H:%m:%s

301.21:12:00

%H:%m:%s.%SSS

301.21:12:00.321

%H:%m:%s.%SSSSSS

201 11:12:21.000001

%H hrs %m mins %s secs

11 hrs 12 mins 21 secs

%H hours %m minutes %s seconds %SSSSSS

1 hours 2 minutes 1 seconds 910001

%s

222222345678

%s.%SSS

1234523.156

%s.%SSSSSS

12345.999999


Duration with days

Formats

Example

%D %H:%m:%s

201 11:12:21

%D %H:%m:%s.%SSS

201 11:12:21.91

%D days %H:%m:%s.%SSSSSS

201 days 11:12:21.000111

%D days %H hrs %m mins %s secs

201 days 11 hrs 12 mins 21 secs

%D days %H hrs %m mins %s secs %SSS

10092 days 11 hrs 12 mins 21 secs 901

%D days %H hours %m minutes %s seconds %SSSSSS

12 days 1 hours 2 minutes 1 seconds 910001

%D days %H hours %m minutes %s seconds %SSS

12 days 1 hours 2 minutes 1 seconds 910


Note: Only the predefined formats displayed under the Duration only and Duration with days sections will be auto inferred on import. However, you can create your own formats using the available formats strings. Click here to know how to create duration formats.

Invalid duration formats

A duration format is invalid if one or more of the following conditions are not met:
  1. The format cannot be empty. 
  2. You can use a string only once in a format. 
    1. For example, in the duration format, 301.201.21:12:00, the duration is repeated twice which makes it an invalid duration format. 
  3. You can use either microsecond or millisecond in a duration format and not both.
    1. For example, in the duration format, 12 days 1 hours 2 minutes 1.911 seconds 1.910001 seconds, both microseconds and milliseconds are used which renders it an invalid duration format.

SEE ALSO