This allows you to get the current date and time and use it how you want, from alerts to mails..
<SCRIPT>
var now=new Date(); // neccessary
var day=now.getDate(); // Day
var month=now.getMonth()+1; // Month (+1 because january = 0)
var year=now.getFullYear(); // Year
var seconds = now.getSeconds(); // Seconds
var minutes = now.getMinutes(); // Minutes
var hour = now.getHours(); // Hours
document.write("",day,"/",month,"/",year," - ",hour,":",minutes,":",seconds); // prints "13/04/2018 - 18:37:32"
</SCRIPT>
EDIT: so as I got downvoted for helping, here's the best thing I can think of right now, because I clearly don't know more. it is the simpliest I can think of.
<p id="time">Getting the current time..</p>
<button onclick="showTime()">Show Time</button>
<script type="text/javascript">
function showTime(){
var now=new Date();
var seconds = now.getSeconds();
var minutes = now.getMinutes();
var hour = now.getHours();
document.getElementById('time').innerHTML = hour + ":" + minutes + ":" + seconds;
}
</script>