Get text string convert to date/time?

Hi everyone,
I need some help with my project.
I am trying to extract current time from a browser web page. Then I should substract this time from the current time.
Would you please suggest what is the best way.

Now I use get text activity to extract the time from the web page.

Hi,
It should be easy, just show us date format from website

1 Like

HI @zhasmina.dimitrova

Check out this expression

StringDur= DateTime.Parse(WebsiteTime).Subtract(DateTime.Parse(DateTime.Now.ToString("hh:mm")))

image

Regards
Gokul

Check out this thread @zhasmina.dimitrova

Regards
Gokul

@zhasmina.dimitrova Tell us the format

@zhasmina.dimitrova
Checktime=DateTime.TryParse(timetext)
Currenttime=Date.Now
Time difference=checktime-currenttime

The date format from the website is hh:mm AM
I am getting it with Get Text activity as string, then convert to time?

Checktime=Convert.ToDateTime(strTime)
Yes,first convert it to time and then subtract it from current time

Hello @zhasmina.dimitrova

If you don’t want to go with the expressions, you can directly sue the Modify Date activity.

Thanks

Have you tried with this expression? @zhasmina.dimitrova