Skip to main content

Use Fractional Seconds in Torq: Enhance DateTime Precision

Learn how to enhance the precision of datetime values by returning fractional seconds in Torq.

Use fractional seconds in DateTime formats

Fractional seconds provide sub-second precision in DateTime values, which is essential for high-accuracy use cases such as log analysis, auditing, and high-speed system monitoring.

In Torq, DateTime values are handled as strings and support fractional seconds formatting.

Control fractional precision

Use %f in your format string to return fractional seconds. By default, %f returns nanoseconds (9 digits).

To control the precision, specify the number of digits between % and f.

It’s important to match the expected precision of the target system or database to ensure compatibility across your workflow.

Supported formats

Fractional unit

Digits

Format

Decisecond

1

%Y-%m-%dT%H:%M:%S:%1f

Centisecond

2

%Y-%m-%dT%H:%M:%S:%2f

Millisecond

3

%Y-%m-%dT%H:%M:%S:%3f

Microsecond

6

%Y-%m-%dT%H:%M:%S:%6f

Nanosecond

9

%Y-%m-%dT%H:%M:%S:%f

Did this answer your question?