![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
Date.toISOString() function in JavaScript
The Date object is a datatype built into the JavaScript language. Date objects are created with the new Date( ) as shown below.
Once a Date object is created, a number of methods allow you to operate on it. Most methods simply allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object, using either local time or UTC (universal, or GMT) time.
The toISOString() function of the date object returns the simplified extended ISO format of the date.
Syntax
Its Syntax is as follows
dateObj.toISOString();
Example
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> var dateObj = new Date('september 26, 89 12:4:25:96'); document.write("Current Date: "+dateObj.toISOString()); </script> </body> </html>
Output
Current Date: 1989-09-26T06:34:25.096Z
Advertisements