ftime(3) Library Functions Manual ftime(3)

ftime - devuelve fecha y hora

Biblioteca Estándar C (libc, -lc)

#include <sys/timeb.h>
int ftime(struct timeb *tp);

NOTA: la biblioteca GNU C ya no incluye esta función. Emplee clock_gettime(2) en su lugar.

This function returns the current time as seconds and milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). The time is returned in tp, which is declared as follows:


struct timeb {
    time_t         time;
    unsigned short millitm;
    short          timezone;
    short          dstflag;
};

Here time is the number of seconds since the Epoch, and millitm is the number of milliseconds since time seconds since the Epoch. The timezone field is the local timezone measured in minutes of time west of Greenwich (with a negative value indicating minutes east of Greenwich). The dstflag field is a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of the year.

POSIX.1-2001 says that the contents of the timezone and dstflag fields are unspecified; avoid relying on them.

This function always returns 0. (POSIX.1-2001 specifies, and some systems document, a -1 error return.)

Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

Interfaz Atributo Valor
ftime() Seguridad del hilo Multi-hilo seguro

None.

Removed in glibc 2.33. 4.2BSD, POSIX.1-2001. Removed in POSIX.1-2008.

Esta función está obsoleta. No la utilice. Si es suficiente con el tiempo en segundos, puede usarse time(2), gettimeofday(2) da el tiempo en microsegundos; clock_gettime(3) da el tiempo en nanosegundos aunque no está disponible todavía en muchos sistemas.

Las primeras versiones de glibc2 contienen varios fallos y devuelven o en el campo millitm. Esta se subsanó en glibc 2.1.1.

gettimeofday(2), time(2)

La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García <gerardo.aburruzaga@uca.es>, Juan Piernas <piernas@ditec.um.es>, Miguel Pérez Ibars <mpi79470@alu.um.es> y Marcos Fouces <marcos@debian.org>

Esta traducción es documentación libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD.

Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a debian-l10n-spanish@lists.debian.org.

31 Octubre 2023 Páginas de manual de Linux 6.06