Possible Duplicate:
How can I format a nullable DateTime with ToString()?
‘No overload for method 'ToString’ takes ‘1’ arguments' error occur While Formating Datetime Field To String ON “dd-MM-yyyy” format
I am using the following:
@Model.Modified.ToString("dd/MM/yyyy htt")
But it gives me a message saying
No overload method for ToString takes one argument
Does anyone have any idea what could be wrong?
Modified property on the model may not be of the type DateTime. Try casting it to DateTime before calling ToString on it.
Update based on the comment
then all you have to do is
because the property is nullable