1
I want to display on the system screen the current/current date and time, which shows the clock incrementing seconds in real time.
I’ve tried using the datetime.now
(shows the date and time, however static, being the time when I loaded the page).
DateTime.today
(only shows the date). I used DateTime.utcNow
also, but equals the first case.
controller:
public IActionResult RegistrarPonto()
{
var aux = new RegistroPontoViewModel { DateTime = DateTime.Now };
return View(aux);
}
view
<div>
<input asp-for="DateTime" type="datetime" class="form-control form-control-lg" readonly />
</div>
https://stackoverflow.com/questions/10211145/getting-current-date-and-time-in-javascript
– Joy Peter