Subtract the Time from current date time

Hey all,

I want to subtract the Time i.e 15 min from the current date time.but I don’t know how to do it .
Can anyone pls help me.

Thanks,

1 Like

@Nidhi2

Try this:

Now.AddMinutes(-15).ToString

3 Likes

hi buddy @Nidhi2

There are many methods that are readily available with datetime class like this
**AddDays(number in integer) **
AddMonths(number in integer)
AddHours(number in integer)
AddMinutes(number in integer)
AddSeconds(number in integer)
AddTicks(number in integer) and many more…

–all these methods will take integer as argument (number in integer), and you can even pass the numbers in negative that would subtract the number of days.

So to get the current date and time we use, Datetime.Now and to subtract 15 mins from it, from one of the mentioned above methods of Datetime, we use AddMinutes()
like this
Datetime.Now.AddMInutes(-15)
–This will subtract 15 minutes from the current time…buddy

For more info on methods available like this in Datetime class in C#, kindly have a view on this that could help you in future as well

Cheers @Nidhi2

1 Like

thanks @Palaniyappan @lakshman.
can you please help me in another problem.
I have an table in which unstructured data exist…

I have tried all the activity to extract that data .but It doesnot work .It gives me blank message box.

Please help how to extract the unstructured data…

2 Likes

try with generate datatable Activity buddy
Did that work

Cheers @Nidhi2

thanks @Palaniyappan
but It didn’t work…

Hi @Nidhi2

Have u tried Build Data table activity

Thanks
Ashwin S

hey @AshwinS2

Yes I have tried it also…

@Nidhi2

Could you please take screenshot of that data and show me. So that I can help you better in this.

Fine buddy
May i know where does this unstructured data exists…do you have that as a string variable or it is still to be extracted from a window or a browser
Cheers @Nidhi2

Hey, I want to subtract time that i retrieve from emails and stored in excel under date column with current time and if the difference is more then 2 hours i want to do some task, so in if activity i am not able to subtract two dates and if activity is itself in for each row activity, ols help