Change of date format

Hello!

I am grabbing dates from a web page and store them as a variable to later put into an excel file. However, the formatting of the dates are like this “Jul 1, 2020, 8:17 PM”. Excel does not recognize this as a date, and I would like to make it so that you could compare the grabbed dates to something like “DateTime.Now.ToString(“yyyy/MM/dd”)”.

Is there any way this can be achieved or is it too difficult and complex of a task?

Best regards
Robert

@Robert_Wennberg Please find below xaml file for your requirment

Main.xaml (5.1 KB)

I have converted date which you extract from web page to “yyyy/MM/dd” format .Please check above file for the same .

If this satisfy please mark it as soln .

Hi @Robert_Wennberg

You can do below thing :-

DateTime.ParseExact(CDate("Jul 1, 2020, 8:17 PM").ToString("MMM dd, yyyy, HH:mm tt"), "MMM dd, yyyy, HH:mm tt", System.Globalization.CultureInfo.InvariantCulture).ToString(“yyyy/MM/dd”)

Workflow :-
MainPratik.xaml (6.4 KB)

Output :-
image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

@Robert_Wennberg
have a look here on a direct (string - datetime - string) conversion

@Pratik_Wavhal

Sorry for the extremely late reply!

This is the solution I was looking for. In my case I just changed the actual date with a variable and it works smoothly.

Thank you so much for your help!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.