[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0: dd-mm-yyyy}")]
public DateTime DateProcessed { get; set; }
This is in my Data Model
and it's giving is 01/01/2015
But I need in this format January/01/2015
result.
I have tried using the ToShortDateString()
. But I am having
error Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
As much as possible. I want it to be in the models instead of using the View. But if it can't be help.
What ever works is fine.