nd02
(nikky)
November 7, 2019, 9:58pm
1
Hi All,
I want to convert timestamp.
Current Format: HH:MM:SS
Expected Format: SSSS
eg- i am trying to calculate the time, which application take to do any transaction. currently it is showing like 00:04:33:12345 (HH:MM:SS:MS)
but i need the result in seconds only, eg 500 seconds instead of HH:MM:SS:MS
4 Likes
zwils0
(Elizabeth Wilson)
November 7, 2019, 10:12pm
2
If you value is in the data type of timespan you can use the .TotalSeconds function:
TimeSpan.Parse(β00:04:33β).TotalSeconds
returns value 273
5 Likes
nd02
(nikky)
November 8, 2019, 2:54pm
3
Can you elaborate more with an example.
zwils0
(Elizabeth Wilson)
November 8, 2019, 3:02pm
4
Attached is a Workflow that does the following:
Stores the Start Time in a variable
Does some processing (in this case a 5s delay)
Stores the End Time in a variable
Calculates the Runtime by subtracting the End Time from the Start Time
Logs the Runtime in total Seconds
Main.xaml (9.8 KB)
4 Likes
When you do this, just output the time using the code he provided. The rest of your calculations can stay the same.
For example if Runtime is a timespan type value you can skip the parse,
Log Message: "Total Runtime: "+runTime.TotalSeconds.ToString+" seconds"
If the Runtime is stored as a string (I donβt know why it would though since you are making a subtraction), then you need the Parse as he presented where you do TimeSpan.Parse(runTimeString).TotalSeconds.ToString
Regards
3 Likes
nd02
(nikky)
November 8, 2019, 3:40pm
6
Thank you it worked, i was using .seconds instead of .totalSeconds, so was getting wrong value.
system
(system)
Closed
November 11, 2019, 3:42pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.