This is the client program to get the time and date. Daytime server is the server program which is provided by the linux, and it has a specific name in the system i.e. "daytime".
#include<stdlib.h>
#include<unistd.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<netdb.h>
int main(int argc,char *argv[])
{
int sockfd,len,ret;
struct sockaddr_in saddr;
char *hname,buff[256];
struct hostent *hostinfo;
struct servent *servinfo;
daytimecli.c
#include<stdio.h>#include<stdlib.h>
#include<unistd.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<netdb.h>
int main(int argc,char *argv[])
{
int sockfd,len,ret;
struct sockaddr_in saddr;
char *hname,buff[256];
struct hostent *hostinfo;
struct servent *servinfo;