I want to display a "Last modified time" in my javascript table. I have searched a lot on date time but I can only find the last modified time on the document. I have some variables in my table (see below question). What i want to do is display the date after i was modified that variable. Can anyone help me ? 🙂
The table what im using with javascript.
`
if(response.length > 0)
{
for (var count = 0;count < response.length; count++)
{
html += '<tr>';
html += '<td>' +response[count].id+'</td>';
html += '<td>€'+response[count].inkoopprijs+'</td>';
html += '<td>€'+response[count].verkoopprijs+'</td>';
html += '<td>' +response[count].producten+'</td>';
html += '<td>' +response[count].create_date+'</td>';
html += '<td>' +response[count].last_modified+'</td>';
html += '<td><a href="../prijswijzigen.php?edit='+response[count].id+'" class="edit_btn">Edit</td>';
html += '<td><a onclick="return confirm()" href="crud.php?del='+response[count].id+'" class="del_btn">Delete</td>';
html += '</tr>';
serial_no++;
}
}
`
html += '<td>' +response[count].last_modified+'</td>';
That line is for my variable last modified that is the same as my create_date variable.
The DOM lastModified property in HTML. That displayed the time of the last time i modified the file.
>Solution :
new Date().toLocaleDateString()
is that what you need?