<html> <head> <script type="text/javascript"> // lấy thời gian hiện tại var time = new Date(); var value = 'toString(): ' + time.toString() + '<br />'; value += 'toUTCString(): ' + time.toUTCString() + '<br />'; value += 'toLocaleString(): ' + time.toLocaleString() + '<br />'; value += 'toTimeString(): ' + time.toTimeString() + '<br />'; value += 'toDateString(): ' + time.toDateString() + '<br />'; value += 'toLocaleDateString(): ' + time.toLocaleDateString() + '<br />'; value += 'toLocaleTimeString(): ' + time.toLocaleTimeString() + '<br />'; value += 'toISOString(): ' + time.toISOString() + '<br />'; value += 'toJSON(): ' + time.toJSON() + '<br />'; value += 'valueOf(): ' + time.valueOf() + '<br />'; value += 'parse(): ' + Date.parse('04 Dec 2018 00:17:00 GMT') + '<br/>'; value += 'parse(): ' + Date.parse(time.toString()) + '<br />'; value += 'now(): ' + Date.now() + '<br />'; value += 'UTC(): ' + Date.UTC(2019, 4, 3, 15, 2, 17) + '<br />'; document.write(value); </script> </head> <body> </body> </html>