Posts

Showing posts from October, 2023

Java Script program to display current date and time using HTML.

Image
 Date and time are the important factors for real time applications. JavaScript includes inbuilt class to get the date and time. date()  is the inbuilt class.  This inbuilt class has many functions listed below.  getDate() - it provides the date as number(1-31)  getMonth() - it displays the month as number getFullYear() - it gives the year in four digit number getDay() - it shows the day of the week in number(0-6) getHour() - it displays the hour information(0-23) getMinutes() - it gives the minutes details( 0-59) getSeconds() -it provides  the seconds details (0-59) getMilliseconds()  -it finds the milliseconds details and gives the information( 0-999) getTime() - it shows the time. these are the inbuilt functions available in date(). Next, create a file in notepad ,save it as "DateDisplay.html" . The program is given below. The <head> tag  is used to set the heading as "Display current date and time" wit h <h1> tag. where <he...