Home >Web Front-end >JS Tutorial >Detailed explanation of the use of toUTCString() method in JavaScript_Basic knowledge
This method converts a date to a string using universal time conventions.
Grammar
Date.toUTCString()
Here are the details of the parameters:
Return value:
Returns a converted date to a string, using common time conventions.
Example:
<html> <head> <title>JavaScript toUTCString Method</title> </head> <body> <script type="text/javascript"> var dateobject = new Date(1993, 6, 28, 14, 39, 7); document.write( dateobject.toUTCString() ); </script> </body> </html>
This will produce the following results:
Wed, 28 Jul 1993 09:09:07 UTC