1
How to manipulate the datetime
and show in view in the following format?
HH:MM dd/MM/aaaa
1
How to manipulate the datetime
and show in view in the following format?
HH:MM dd/MM/aaaa
1
Without you using it jQuery
you can use the plugin Datetimepicker.
Just read the documentation and apply to the fields you want this format.
An example would be to do something like this in HTML
:
<input class="datetimepicker" type="text"/>
and so on javascript
:
$('.datetimepicker').datetimepicker();
for this to work you must use the files JS
and CSS
plugin in conjunction with the jQuery
.
in this format: Tostring("HH:mm dd/MM/yyyy") soh shows me the date and Time Reset.
You checked if the date is with the values of hours and minutes in the database?
1
No Controller
ViewData['MinhaDataMinhaVida'] = DateTime.Now;
Na View
<input type='text' value='<%=ViewData['MinhaDataMinhaVida'].ToString("HH:mm dd/MM/yyyy") %>'> </input>
I haven’t tested it, but I think it’s correct.
https://msdn.microsoft.com/pt-br/library/8kb3ddd4(v=vs.110). aspx
1
If using Razor, you can use @Html.TextBoxFor()
specifying a date format:
@Html.TextBoxFor(model => model.MinhaData, "hh:mm dd/MM/yyyy", new { @class = "form-control" })
Note: the class "form-control" is from Bootstrap 3.
Browser other questions tagged asp.net-mvc datetime view
You are not signed in. Login or sign up in order to post.
You want to display in this format using an input or just display as text?
– Richard Dias
Using an input
– Hans Miller
Is using Razor ?
– PauloHDSousa