Date.setUTCHours

setUTCHours – Set the hours, according to universal time (0–23).

Description

Date.setUTCHours(integer hours)

Parameters

Name Description Type Default Optional
hours integer No

Return values

Integer. The new timestamp.

Examples

Example #1 – setUTCHours example
var date = new Date(Date.UTC(2015, 9, 21, 16, 29, 00)); console.log(date.getTime()); // 1445444940000 console.log(date.setUTCHours(10)); // 1445423340000

External references