
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to return a string representing the source for an equivalent Date object?
To return a string representing the source for an equivalent Date object, use the JavaScript toSource() method. This method returns a string representing the source code of the object.
Example
You can try to run the following code to return a string representing the source for an equivalent Date object −
<html> <head> <title>JavaScript toSource() Method</title> </head> <body> <script> var dt = new Date(2018, 0, 15, 14, 39, 7); document.write( "Formated Date : " + dt.toSource() ); </script> </body> </html>
- Related Articles
- How to convert a Python date string to a date object?
- How to create JavaScript Date object from date string?
- How to convert a JavaScript date object to a string?
- Return the scalar dtype or NumPy equivalent of Python type of an object
- How do we evaluate a string and return an object in Python?
- How to return the "time" portion of the Date as a human-readable string.
- How to convert a string in to date object in JavaScript?
- How to set a String as a key for an object - JavaScript?
- Python - Return an array representing the data in the Pandas Index
- How to return an object from a JavaScript function?
- How to convert a String into a Date object using JDBC API?
- How to “return an object” in C++?
- How to call the key of an object but return it as a method, not a string in JavaScript?
- How to represent the source code of an object with JavaScript Arrays?
- How to return an object from a function in Python?

Advertisements