current date time using sweet alert in html

<!DOCTYPE html>
<html lang="en">
   <head>
      <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
      <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
   </head>
   <body>
      <script>
         var currenttime = moment().format('D MMM YYYY h:mm A');
         //alert(currenttime);
         swal("Current Time"+" : "+currenttime, {
         title:currenttime,
         button: false
         });
      </script>
   </body>
</html> 

Post a Comment

0 Comments