Articles in this section
Category / Section

How to Convert Seconds to Time String Format (HH:mm:ss) in Bold Reports

Published:
Updated:

Converting seconds to a time string format (HH:mm:ss) is a common requirement in various applications, especially when dealing with time-related data. This conversion improves the presentation and understanding of time durations. In this Knowledge Base (KB) article, we’ll discuss how to perform this conversion and effectively integrate it into report items using the Bold Reports Built-in Functions DateAdd and CDate.

You can directly convert seconds into your desired time string format (HH:mm:ss) using the DateAdd and CDate functions. Refer to the following expression for guidance.

   =Format(DateAdd("s", Fields!Column_Name.Value, CDate("00:00:00")), "HH:mm:ss")
  • CDate: This part of the expression converts the string “00:00:00” into a date and time value. The purpose is to establish a starting point for adding seconds to calculate a new time value.

  • DateAdd: Utilize the DateAdd function to add a number of seconds (Fields!Column_Name.Value) to the time value obtained from CDate. This function calculates a new date and time value by adding the specified number of seconds to the starting time of midnight.

To convert seconds into time string format (HH:mm:ss), insert the provided expression into a column where you want to display the converted time string format. This column should correspond to the dataset field containing the number of seconds to be converted.

image.png

Converting seconds to the time string format (HH:mm:ss) provides a simple method for representing time durations in reports. By following the outlined steps and incorporating the provided expression into a table report item, you can effectively display time-related data in the desired format, enhancing readability and comprehension for end-users.

For reference, you can download the sample report, Seconds to Time String Format .rdl.

See Also

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied