How to write date and time and which rtc component?

Arduino based small weather station coding

#include <DHT.h>

#define DHTPIN 2

#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {
0x90, 0xA2, 0xDA, 0x00, 0x23, 0x36 };
IPAddress ip(192,168,254,177);

EthernetServer server(80);

void setup() {

Serial.begin(9600);
while (!Serial) {

}

dht.begin();

Ethernet.begin(mac, ip);
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}

void loop() {

float h = dht.readHumidity();
float t = dht.readTemperature();

if (isnan(t) || isnan(h)) {
Serial.println("Failed to read from DHT");
} else {
Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
Serial.println(" *C");
}

EthernetClient client = server.available();
if (client) {
Serial.println("new client");

boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);

if (c == '\n' && currentLineIsBlank) {

client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close");
client.println("Refresh: 5");
client.println();
client.println("");
client.println("");

client.println("

");
client.print("Humidity: ");
client.println("

");
client.println("

");
client.println("

");
client.print(h);
client.print(" %\t");
client.println("

");
client.println("

");
client.println("

");
client.print("Temperature: ");
client.println("

");
client.println("

");
client.print(t*1.8+32);
client.println(" °");
client.println("F");
client.println("

");

client.println("");
break;
}
if (c == '\n') {

currentLineIsBlank = true;
}
else if (c != '\r') {

currentLineIsBlank = false;
}
}
}

delay(1);

client.stop();
Serial.println("client disonnected");
}
}

It would be more helpful if your code were in code tags (leftmost icon above the editor window) with extraneous blank lines removed and if you described exactly what you want to do and what problems you are experiencing.

            client.println("</H1>");
            client.println("<p />");
            client.println("<H2>");

Each of these causes a packet to be sent from the server to the client. A packet can hold up to about 512 characters. Sending 3 packets, containing not more than 5 characters, when one packet would suffice is wasteful.