forum

Home / DeveloperSection / Forums / DateTime.Now in Model C# ASP.NET MVC 4

DateTime.Now in Model C# ASP.NET MVC 4

Anonymous User 7221 06-Mar-2014

I have created a model for Articles, and in the articles I am trying to implement a date created on initial create.

//Model

    [Display(Name = "Date Created")]

    public DateTime dateCreated

    {

        get { return DateTime.Now; }

    }

It works well when I create an article, but it also sets the same date time value to all the other articles. :/

Is there a way around this?


Updated on 06-Mar-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By