75
JavaScript Date toUTCString() method
The JavaScript date toUTCString() method returns the specified date in the form of string using the UTC time zone .
Syntax
The toUTCString() method is represented by the following syntax:
Return
A string representing the specified date.
JavaScript Date toUTCString() method example
Here, we will understand toUTCString() method through various examples.
Example 1
Let’s see an example to fetch current date in the form of string.
Output:
Thu, 09 Aug 2018 11:41:19 GMT
Example 2
Let’s see an example to fetch the specified date in the form of string.
Output:
Fri, 15 Aug 1947 14:52:10 GMT
Next TopicJavaScript Date