how to display the date and time with javascript code example Example: calculate today date javascript var today = new Date();