Advertisement
AnindyaBiswas

DateTimePage

May 16th, 2023
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const http = require('http');
  2. //the custom module for date and time
  3. const dateTime = require('./datetimemodule.js');
  4.  
  5. http.createServer(function(req, res){
  6.  
  7.     //Some css in this div
  8.     res.write("<div style='text-align:center; font-family:Calibri; font-size:40px'>");
  9.     //Date
  10.     res.write("<h1>Date : " + dateTime.DateTime().date + "</h1>");
  11.     //Time
  12.     res.write("<h1>Time : " + dateTime.DateTime().time + "</h1>");
  13.     //Day
  14.     res.write("<h1>Day : " + dateTime.DateTime().day + "</h1>");
  15.  
  16.     res.write("</div>");
  17.     res.end();
  18.  
  19. }).listen(8050);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement