Lấy ngày giờ hiện tại HTML
RUN
<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div id="current-time"></div> <script> var curDate = new Date(); // Ngày hiện tại var curDay = curDate.getDate(); // Tháng hiện tại var curMonth = curDate.getMonth() + 1; // Năm hiện tại var curYear = curDate.getFullYear(); // Gán vào thẻ HTML document.getElementById('current-time').innerHTML = curDay + "/" + curMonth + "/" + curYear; </script> </body> </html>
PHÓNG TO