InterviewSolution
Saved Bookmarks
| 1. |
Get the unicode of the character at a specified index in a string with JavaScript |
|
Answer» The Date.parse() method is USED in JavaScript to parse a string representation of date and time. Let us first see the syntax: Date.parse(STR)Here, str is the date string. The method parses the date and returns the number of MILLISECONDS SINCE midnight of January 1, 1970. Let us see an example now: <!DOCTYPE html> <html> <body> <script> var res = Date.parse( "Dec 14, 2018 16:45:00" ); document.write( "Number of milliseconds between the date MENTIONED above and 1970 = " + res ); </script> </body> </html>The output: Number of milliseconds between the date mentioned above and 1970 = 1544786100000 |
|