javascript getDay() method


  Translation results:

get

英[get] 美[ɡɛt]

vt. Get; catch; persuade; receive (punishment, etc.)

vt.& vi. Arrive, come

vi. Become; start; try to deal with; obtain benefits or wealth

n. Reproduce, cub; profit

Third person singular : gets present participle: getting past tense: got past participle: got gotten

day

##英[deɪ] 美[de]

n. day; day; period; festival

adj. daytime; day by day

adv. every day; often during the day

Plural: days

javascript getDay() methodsyntax

Function: Returns the number representing a certain day of the week.

Syntax: dateObject.getDay()

Returns: The day of the week pointed to by dateObject, using local time. The return value is an integer between 0 (Sunday) and 6 (Saturday).

Note: This method is always used in conjunction with a Date object.

javascript getDay() methodexample

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">

    var d=new Date()
    document.write(d.getDay())

</script>

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance

Home

Videos

Q&A