Search Events: String was not recognized as a valid DateTime when trying to get the exact date

Can you list the dependencies you use in this file? It gives a missing activities error.

@Jeroen_van_Loon

EventResults(0).Start.DateTime.ToString(" ddd MMM d, yyyy h:mm:00 “) = (DateTime.Now.ToString(” ddd MMM d, yyyy h:mm:00 "))

I am having this error can you fix it?

Error ERROR Validation Error Compiler error(s) encountered processing expression “EventResults(0).Start.DateTime.ToString(” ddd MMM d, yyyy h:mm:00 “) = (DateTime.Now.ToString(” ddd MMM d, yyyy h:mm:00 “))”.
Option Strict On disallows implicit conversions from ‘String’ to ‘Integer’.

I’m not even sure what you want to accomplish with your expression.
Please just list the dependencies of your code (the packages) so I can look at the example you uploaded.

@Jeroen_van_Loon If statement
if the output for the event search “Event result” Date equals to the date of now

But I want to change the date of now format to count the time without the seconds.

So to compare that with the dat and time coming from my calendar in the event search.

Hi @Zeid_Abawi_MiddleEast ,

I think the error is because the Start.DateTime method is not similar to the System.DateTime and hence you cannot convert the String form of DateTime directly using the .ToString() method.

That is the reason you get the below error:

Option Strict On disallows implicit conversions from ‘String’ to ‘Integer’.

So, let’s try to handle that by using the Expression below. Although I have not used GSuite or SearchEvents activities, the conversion using CDate should be able to work.

CDate(EventResults(0).Start.DateTime.ToString).ToString("ddd MMM d, yyyy h:mm:00") = Now.ToString("ddd MMM d, yyyy h:mm:00")

Let us know if it still doesn’t work.

@supermanPunch Yes it worked fine thank you!!

1 Like