Disallows implicit conversion from 'string' to 'System.IFormatProvider'

here i am trying to get “dd” from previous date but first let me show how did i get the pervious date by using CurrentDayMinusOne = “DateTime.now.AddDays(-1).ToString(“dd-MM-yyyy”)” and when i try to get “dd” value from it i got an error and this is how i tried to get a “dd” value varToDay = “Cint(CurrentDayMinusOne.ToString(“dd”)).ToString”
please any help could be apprecited

regards,
kaavya

Hi,

CurrentDayMinusOne seems String type. So can you try the following?

varToDay = CurrentDayMinusOne.Split({"-"c})(0)

Or, If varToDay is Int32 type, the following will work.

varToDay = CInt(CurrentDayMinusOne.Split({"-"c})(0))

Regards,

1 Like

thank you @Yoichi

1 Like

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