/*--------------------------------------------------------------------
 * FICHERO:  TimDia.c
 * OBJETIVO: Definir la funcin Tim_Dia()
 * AUTOR:    Pedro Reina
 * FECHA:    J.20.4.1995
 *------------------------------------------------------------------*/

/*--------------------------------------------------------------------
 * Ficheros de cabecera
 *------------------------------------------------------------------*/

#include "Tiempo.h"

#ifdef OLIMPO_PC
#include <dos.h>                /*  struct date  getdate()          */
#endif

#ifdef OLIMPO_QL
#include <qlib.h>               /* mt_rclck()  cn_date()            */
#include <stdlib.h>             /* atoi()                           */
#endif

/*--------------------------------------------------------------------
 * Definicin de funciones
 *------------------------------------------------------------------*/

/*--------------------------------------------------------------Olimpo
 * FUNCION:  Tim_Dia()
 * OBJETIVO: Decir el da en curso
 * ENTRADAS: Ninguna
 * SALIDAS:  El da en curso
 * EJEMPLO:  Tim_Dia ()
 *------------------------------------------------------------------*/

#ifdef OLIMPO_PC
octeto Tim_Dia()
  {
  struct date d;
  getdate(&d);
  return ( (octeto) (d.da_day) );
  }
#endif

#ifdef OLIMPO_QL
octeto Tim_Dia()
  {
  char FechaQL[25];

  cn_date (FechaQL,mt_rclck());
  FechaQL[13] = NULO;

  return ( (octeto) atoi(FechaQL+11) );
  }
#endif
