javaScript Date set UTC milliseconds

javascript date set UTC milliseconds. Here we will explain, how to date sets UTC milliseconds using the javaScript setUTCMilliseconds() method.

JavaScript: setUTCMilliseconds() Method

Definition:- The setUTCMilliseconds() is an inbuild javascript method, which is used to sets the millisecond of a date object, according to the universal time (UTC).

Note: This method accepts one parameter and values between 0 to 999.

Syntax

Date.setUTCMilliseconds(millisec);

Parameter of setUTCMilliseconds() Method

ParameterDescription
millisecIt allows only one parameter and it will be required. You can pass values integer value from 0-999 in this parameter

If you want to pass the following

1. seconds in setUTCSeconds() method:

 Date.setUTCMilliseconds(milliseconds)

Example

Here we will take first example of setUTCMilliseconds method, with passing milliseconds in method:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>javascript date set utc milliseconds</title>
</head>
<body>
  <script type = "text/javascript">
     var date = new Date();
     date.setUTCMilliseconds(100);
     document.write( "javascript date set utc milliseconds using setUTCMilliseconds() : " + date );
  </script>
</body>
</html>

Result of example is

javascript date set utc milliseconds

Conclusion

In this javascript tutorial, you have learned how to date set UTC milliseconds with milliseconds parameters using setUTCMilliseconds method with an example.

You may like

  1. JavaScript: Date setUTCDate() Method
  2. Set UTC Month In javaScript
  3. setUTCFullYear() Method JavaScript With Examples
  4. javascript date setUTCHours() Method With Examples
  5. JavaScript: d.setUTCMinutes() Method e.g.
  6. setUTCSecond() Method By JavaScript
  7. JavaScript: Date.getUTCDate() Method
  8. getUTCmonth Method javaScript With Example
  9. javaScript Digital Clock with date
  10. JavaScript: Set Date Methods
  11. String Contains JavaScript | String includes() Method
  12. JavaScript Get Date Methods
  13. JavaScript Operators With Examples
  14. Sorting Using JavaScript Array Sort() Method
  15. JavaScript Replace String With Examples
  16. JavaScript Array splice() Method By Example
  17. JavaScript: Clone an Array & Object By Example
  18. 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.

AuthorDevendra Dode

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 *