![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set the full year for a specified date according to universal time.
JavaScript date setUTCFullYear() method sets the full year for a specified date according to universal time.
The following are the parameters for setUTCFullYear(yearValue[, monthValue[, dayValue]]) −
- yearValue − An integer specifying the numeric value of the year, for example, 2008.
- monthValue − An integer between 0 and 11 representing the months January through December.
- dayValue − An integer between 1 and 31 representing the day of the month. If you specify the dayValue parameter, you must also specify the monthValue.
Example
You can try to run the following code to set the full year for a specified date according to universal time −
<html> <head> <title>JavaScript setUTCFullYear Method</title> </head> <body> <script> var dt = new Date( "Aug 28, 2012 23:30:00" ); dt.setUTCFullYear( 2018 ); document.write( dt ); </script> </body> </html>
Advertisements