getUTCFullYear javaScript  Method With Example

getUTCFullYear javaScript Method With Example

JavaScript: Date.getUTCFullYear() method. In this tutorial, you will learn how to get utc full year in javascript with an example.

Date.getUTCFullYear() Method in JavaScript

Definition:- Javascript date getUTCFullYear() method is used to get the full year in the specified date according to universal time. The getUTCFullYear method will return an integer value between 1000 and 9999.

Syntax

The syntax is date.getUTCFullYear method is:

 Date.getUTCFullYear()

Example

Now we will take an example of getUTCFullYear() method:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JavaScript date.getUTCFullYear Method</title>
</head>
<body>
  <script type = "text/javascript">
     var currentDate = new Date();
     document.write("the javascript date.getUTCFullYear() : " + currentDate.getUTCFullYear() ); 
  </script>  
</body>
</html>
Note:  If you want to use custom date with getUTCFullYear method, you can use like var date = new Date( "December 5, 1999 24:14:11" );

Result of the above code is

JavaScript date.getUTCFullYear Method

Conclusion

In this javascript tutorial, you have learned how to get a full year using getUTCFullYear function with example.

You may like

  1. JavaScript: Date.getUTCDate() Method
  2. getUTCmonth Method javaScript With Example
  3. javaScript Digital Clock with date
  4. JavaScript: Set Date Methods
  5. String Contains JavaScript | String includes() Method
  6. JavaScript Get Date Methods
  7. JavaScript Operators With Examples
  8. Sorting Using JavaScript Array Sort() Method
  9. JavaScript Replace String With Examples
  10. JavaScript Array splice() Method By Example
  11. JavaScript: Clone an Array & Object By Example
  12. Check the Object is Array or not in javascript

If you have any questions or thoughts to share, use the comment form below to reach us.

AuthorAdmin

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *