/*


	TIME.C affichage HTML de l'heure et la date sur la sortie standard
	

*/


#include	<stdio.h>
#include	<string.h>
#include	<stdlib.h>
#include	<time.h>

#ifdef __SOZOBONX__
	#include <atari.h>
#else
	#include <tos.h>
#endif

#include <portab.h>

/* ---       Includes internes       -- */

/* --- Constantes globales internes --- */

/* --- Structures globales internes --- */

/* --- Variables globales  internes --- */

/* ---     Prototypage interne      --- */

INT main(VOID);

/************************************************************************/

INT main(VOID)
{
BYTE	str_today[40];
ULONG	ul_today;

	time(&( (time_t)(ul_today) ));
	strftime(str_today,40,"%A %d %B %Y %X",localtime(&((time_t)(ul_today))));

	fprintf(stdout,"Content-type: text/html\n\n");

	fprintf(stdout,"<html><head><title>A l'Heure du jour</title></head><Body><h3>A l'heure du jour</h3><hr><pre>\n");
	fprintf(stdout,"La pendule indique : %s\n",str_today);

	fprintf(stdout,"</pre></body></html>\n");

return(0);
}
