I am a compelte Knowbie so excuse my quesstion if it comes across dumb, i have created a small web application at the folliwng https://wireme.co.uk/BookList but i can not get the date to display correctly, not sure what i am doing wrong, please see my code below:
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace BookListRazor.Model
{
public class Book
{
[Key]
public int PO { get; set; }
[Required]
public string Creator { get; set; }
[Required]
public string Company { get; set; }
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy")]
public DateTime Date { get { return Mydate; } set { Mydate = value; } }
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy")]
public DateTime Mydate = DateAndTime.Now;
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy")]
public DateTime MyDate { get; set; }
}
}