Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Show different methods to convert integer-based time values (stored in seconds or hours) into a readable time format using Finished Reports and Visualize.
What Are Integer-Based Time Values?
In some data sources, time values are stored as integers, typically representing:
Seconds — e.g.,
600= 10 minutes,3600= 1 hourHours — for military-style hour formatting
These values need to be transformed into readable HH:mm:ss or hh:mm tt format for reporting and display.
Tip: Use addseconds or format string logic to simplify this process inside Finished Reports or Visualize.
Download Sample
Method 1: Finished Reports – Manual Time Formatting
Step-by-Step
1. Add a Label to the report design area
2. Click the Label Tasks drop-down (cog icon on the label) and open the Expression Editor
3. Paste the following expression:
4. Replace [YourField] with the field name holding the time value
5. Click OK, then Preview the report
Tip: This converts raw seconds into HH:mm:ss.
Method 2: Finished Reports – Using addseconds() (Recommended)
Step-by-Step
1. Right-click in the Field List → Add Calculated Field
2. Set the Data Source and Field Type
3. In the Expression Editor, paste: addseconds('1/1/1900', [YourField])
4. Replace [YourField] with your time field
5. Drag the calculated field into your Finished Report layout
6. Format it using: {0:HH:mm:ss}
Recommended: Cleaner and easier to maintain than manual parsing.
Method 3: Finished Reports – Military Time with addhours()
Step-by-Step
1. Add a Calculated Field
2. Set the data source and data type as needed
3. Open the expression editor
4. Paste the following expression: addhours('1/1/1900', [YourField])
5. Replace [YourField] with your hours-based integer field
6. Format the field using: {0:hh:mm tt}
Useful when integer values represent whole hours, like 14 for 2:00 PM.
Method 4: Visualize – Custom Expression for HH:mm:ss
Step-by-Step
1. Create a Calculated Field
2. Paste the following expression:
Iif(ToInt([YourField] % (24 * 60 * 60) / (60 * 60)) < 10, '0' +
ToStr([YourField] % (24 * 60 * 60) / (60 * 60)),
ToStr([YourField] % (24 * 60 * 60) / (60 * 60)))
+ ':' +
Iif(ToInt([YourField] % (60 * 60) / 60) < 10, '0' +
ToStr([YourField] % (60 * 60) / 60),
ToStr([YourField] % (60 * 60) / 60))
+ ':' +
Iif(ToInt([YourField] % 60) < 10, '0' +
ToStr([YourField] % 60),
ToStr([YourField] % 60))
3. Replace [YourField] with your seconds-based field
4. Add the calculated field to your Visualize layout and preview the result
Tip: This method allows full customization of time formatting inside dashboards.
Article Summary
If your dataset includes time stored as integer seconds or hours, VDM offers several ways to convert those into readable formats:
Use manual string formatting or addseconds() in Finished Reports
Use addhours() for military time conversion
Use custom expressions in Visualize for on-screen dynamic formatting
Use Case: Convert 3600 into 01:00:00 for a performance dashboard or show 14 as 2:00 PM using military formatting in a report.
Comments
0 comments
Please sign in to leave a comment.