use javascript to display time code example Example: calculate today date javascript var today = new Date();