voy a probar de todo pero no funciona esto (/aaaa dd/MM) Formato de fecha, esto siempre puerta dd/mm/aaaaNo se puede establecer el formato de fecha y hora en MVC 4 utilizando anotaciones de datos
[Display(Name = "Release Date")]
[DataType(DataType.DateTime)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
public Nullable<DateTime> release_date { get; set; }
Razor vista
@Html.EditorFor(model => model.release_date)
uso de plantilla DateTime.
@model Nullable<System.DateTime>
@if (Model.HasValue)
{
@Html.TextBox("", String.Format("{0:dd/MM/yyyy}", Model.Value))
}
else
{
@Html.TextBox("", String.Format("{0:dd/MM/yyyy}", DateTime.Now))
}
@{
string name = ViewData.TemplateInfo.HtmlFieldPrefix;
string id = name.Replace(".", "_");
}
<script type="text/javascript">
$(document).ready(function() {
$("#@id").datepicker({
dateFormat: "dd/mm/yy",
showStatus: true,
showWeeks: true,
highlightWeek: true,
numberOfMonths: 1,
showAnim: "scale",
showOptions: {
origin: ["top", "left"]
}
});
});
</script>
De la imagen se ve como el la fecha es 'dd/mm/aaaa' – Habib
Tenga en cuenta que" mm "son los minutos, aparte de cualquier otra cosa, por lo que probablemente quiera decir" dd/MM/aaaa ". –
sí esto es (24/08/2012) dd/MM/aaaa – Sender