- 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
How to convert a date to a string using the universal time convention?
To convert a date to a string using the universal time convention, use the toUTCString() method. It returns converted the date to a string, using the universal time convention.
Example
You can try to run the following code to learn how to convert a date to a string using UTC −
<html> <head> <title>JavaScript toUTCString Method</title> </head> <body> <script> var dateobject = new Date(2018, 0, 15, 14, 39, 7); document.write( dateobject.toUTCString() ); </script> </body> </html>
Advertisements