MVC如何添加一个TimePicker

MVC how to add a TimePicker

我想知道如何将时间选择器集成到应用程序中。我想要实现的是添加旅程创建的出发时间和到达时间的能力。我已经设法在模型中设置了日期,但现在我仍然停留在如何围绕它建立时间上。

型号:

    [Key]
    public int JourneyId { get; set; }
    public string Description { get; set; }
    [DataType(DataType.Date)]
    [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
    public DateTime Departure { get; set; }
    [DataType(DataType.DateTime)]
    [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
    public DateTime Arrival { get; set; }
    public string DepartingFrom { get; set; }
    public string Destination { get; set; }
    public int StationId { get; set; }
    public int TrainId { get; set; }
    public virtual Train Train { get; set; }
    public virtual Station Station { get; set; }

请帮忙

实际上我刚刚所做的是向模型

添加了一个额外的 属性
 [DataType(DataType.Time)]
    public DateTime DepartureTime { get; set; }

然后在视图中使用它