How to add current time Hours+Minutes+Seconds..Add individual charecters..,

Hi Guys,

I want to add current time…let say my current time is 1:45:20. i want to add like this 1+4+5+2+0=12

Please help me out.

Thanks,
Suresh.

You can split the value to characters and then you can add it

chararray = String.Replace(“:”,0).ToChararray

Loop it and add it

Hope this helps you .

Hello @karthick,

thanks for your quick reply…

i will attach my xaml file please go through it and help me out.

Thanks,
Suresh.Main.xaml (12.3 KB)

Please refer,
SumOfDigitsInNumber.xaml (8.0 KB)

Call the workflow by passing the hours, minutes and seconds value one by one like
Datetime.Now.Hour
Datetime.Now.Minute
Datetime.Now.Second

Then add each of these values to get one sum.

Example :- 12:45:34:
Will this flow gives the answer as 19 ?

Implement how much ever you understood and send the workflow. Will review and update.
Example :- 12:45:34: will not work
Use invoke workflow activity and pass the hour value as input. Store the result value in a integer variable, v1.
Use invoke workflow activity and pass the minutes value as input. Store the result value in a integer variable, v2.
Use invoke workflow activity and pass the seconds value as input. Store the result value in a integer variable, v3.
now add all the three variable values, v1+v2+v3.