set

英[set] 美[sɛt]

vt. Set; place, arrange; put in a certain situation; place tableware

vi. Setting off; setting off; condensation

n.Gathering; a set; a set; a TV set

adj. Fixed; located in...; stubborn; arranged The

third person singular: sets plural: sets present participle: setting past tense: set past participle: set

time

英[taɪm] Beauty [taɪm]

n. Time; time; era; time

vt. Arrange time for...; measure the time of...; adjust the (mechanical) speed; set the (clock, The speed of a watch

vi. in time; in harmony; in time

adj. Timing; regular; [American English] installment (payment)

int.[ Sports] time is up, the time limit of the game (a game or a game, etc.), pause

Third person singular: times Plural: times Present participle: timing Past tense: timed

javascript setTime() method syntax

Function: Set the Date object in milliseconds.

Syntax: dateObject.setTime(millisec)

Parameters: millisec Required. The date and time to be set are the number of milliseconds between midnight GMT January 1, 1970. A millisecond value of this type can be passed to the Date() constructor, which can be obtained by calling the Date.UTC() and Date.parse() methods. Representing the date in milliseconds makes it time zone independent.​

Return: Return parameter millisec. Before ECMAScript was standardized, this method did not return a value.

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

javascript setTime() method example

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

<script type="text/javascript">
//向 1970/01/01 添加 77771564221 毫秒,并显示新的日期和时间
    var d = new Date()
    d.setTime(77771564221)
    document.write(d)

</script>

</body>
</html>

Run instance »

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