I have created dataset in coderepo with two columns in my table with a timestamp data type:
start_time
end_time
I’ve created a new column called time_diff to calculate the difference between these timestamps.
Logic:
time_diff = start_time - end_time
Expected outcome:
User can input timestamp in above mentioned columns. While in registration using form the time_diff column should automatically display the time difference in a human-readable format, suitable for both the “Workshop” and “ObjectExplorer” . Here are some examples:
5 min 13 sec (for a short duration)
10 days, 15 hours, 13 sec (for a longer duration)
This way, the time_diff column provides a clear and easy-to-understand representation of the elapsed time between the start_time and end_time.
Please provide suggestions on how to best solve this in Ontology app or Workshop or in Functions
Try something like this. For this to work, your difference should be in milliseconds. The output is a FunctionsMap with key as the object and value as the difference in human readable format (string) so you can add it as a column in an object table in Workshop.