Javascript examples for String Operation:String Parse
Parse string in format of "2018-03-02T15:30:18-08:00" to Date
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script type="text/javascript"> var d1 = "2018-03-02T15:30:18-08:00"; var d2 = "2018-03-02T15:36:05-08:00"; if (new Date(d1) < new Date(d2)) {//from w ww . ja v a 2s .c o m console.log('newer') } </script> </body> </html>