Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

pls send me currect answers. Create a JavaScript program that will write the cur

ID: 3901679 • Letter: P

Question

pls send me currect answers.

Create a JavaScript program that will write the current date, day and time to your Web page. Please do NOT use an alert() function for your output. Your output must match the format/example below:

Time, example: 3:15 PM

Day, example: Wednesday

Month, example: September

Date, example: 21

Output example:

It is currently: 3:15 PM on Wednesday, September 21.

Important

Your output

must include all of the text and punctuation shown in the example above

must not display seconds as a part of the current time

must indicate whether the time is AM or PM (no 24 hour format)

day and month must be displayed in complete words, no abbreviations or numeric representations of day and month

must be boldfaced and italicized

must be generated from an external JavaScript (.js) file

Explanation / Answer

If you have any doubts, please give me comment..

index.html

<!DOCTYPE html>

<html>

<head>

<script src="time.js"></script>

</head>

<body>

</body>

</html>

time.js

var date = new Date();

var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];

var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

var hours = date.getHours();

var minutes = date.getMinutes();

var ampm = hours >= 12 ? 'PM' : 'AM';

hours = hours % 12;

hours = hours ? hours : 12;

minutes = minutes < 10 ? '0'+minutes : minutes;

var month = months[date.getMonth()];

var weekday = days[date.getDay()];

var strTime = hours + ':' + minutes + ' ' + ampm+" on "+weekday+", "+month+" "+date.getDate();

document.write("<b>It is currently: "+strTime+".</b>");