
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
Set the hour for a specified date according to universal time?
JavaScript date setUTCHours() method sets the hour for a specified date according to local time. The following is the parameter for setUTCHours(hoursValue[, minutesValue[, secondsValue[, msValue]]]) −
- hoursValue − An integer between 0 and 23, representing the hour.
- minutesValue − An integer between 0 and 59, representing the minutes.
- secondsValue − An integer between 0 and 59, representing the seconds. If you specify the secondsValue parameter, you must also specify the minutesValue.
- msValue − A number between 0 and 999, representing the milliseconds. If you specify the msValue parameter, you must also specify the minutesValue and secondsValue.
Example
You can try to run the following code to set the hour for a specified date according to universal time −
<html> <head> <title>JavaScript setUTCHours Method</title> </head> <body> <script> var dt = new Date( "Aug 28, 2008 23:30:00" ); dt.setUTCHours( 15 ); document.write( dt ); </script> </body> </html>
- Related Articles
- Set the milliseconds for a specified date according to universal time.
- Set the seconds for a specified date according to universal time.
- Set the minutes for a specified date according to universal time.
- Set the month for a specified date according to universal time.
- Set the full year for a specified date according to universal time.
- Set the day of the month for a specified date according to universal time?
- How to return the day of the week in the specified date according to universal time?
- How to convert a date to a string using the universal time convention?
- How to set default date time as system date time in MySQL?
- Insert current time minus 1 hour to already inserted date-time records in MYSQL
- What is the universal set and complement of a set?
- Set current date and time to timestamp in MySQL
- How to convert 12-hour time scale to 24-hour time in R?
- How to set the xticklabels for date in matplotlib?
- Set the Date and Time with Gregorian Calendar in Java

Advertisements