TestProject Forum

Convert text to time format

Hi team,

can you help me in the below scenario.
1.i want to covert below text to time format because I want to verify each time I login I need to check this time stamp with local time

  1. for this one I used as get text method and stored in one variable :November 03 2021,11:21 AM
    2.I used getcurrent time methode: I get Nov 03, 2021 12:02

so I need to compare both times.so please help on this one

Hi @mani_mpart,
You can use the Get the current DateTime action with same format as your website shows
for example:

then when using the get text the text retrieved and the current date time should be at the same format
so you can use the Compare Dates action with the same format
for example:

Please let me know if that helped.

Hi Tal

How do you invoke the “Get the current DateTime action” from above? I never see the option to do this despite installing the add on?

Thanks
Jamie

I can see the action now however when i run the step nothing is populated in the field? Any ideas what I am doing wrong? Thanks in advance.

thanks, Tal its working as expected.

1 Like