I am trying to handle dateTime. I have created dateCreated field which is using Now(). Could I add other calculated dateTime field, which is added two days automatically.
For example, dateCreated is created on 18th March 2012. I want to create new dateTime value which set on 20th March 2012. Is it possible to calculate date in model?
Here is my code. Thanks.
public class Cart
{
[Key]
public int recordId { get; set; }
public string cartId { get; set; }
public int productId { get; set; }
public int count { get; set; }
public DateTime dateCreated { get; set; }
// Can I make startDate as adding two days with dateCreated?
// Is there any calculation for this?
//public DateTime startDate { get; set; }
public virtual Product Product { get; set; }
}
1 Answer