Time.h

Time.h

time.h

time.h es un archivo de cabecera de la biblioteca estándar del lenguaje de programación C que contiene funciones para manipular y formatear la fecha y hora del sistema.

Contenido

Funciones

Nombre Descripción
char * asctime(struct tm *) Recibe una variable de tipo puntero a estructura tm (struct tm*) y devuelve una cadena de caracteres cuyo formato es:
"Www Mmm dd hh:mm:ss yyyy" (ej: Tue May 15 19:07:04 2008)
clock_t clock (void) Devuelve el número de pulsos de reloj desde que se inició el proceso
char * ctime(time t *) Recibe una variable de tipo puntero a time t (time t*) y devuelve una cadena con el mismo formato que asctime()
double difftime(time t, time t) Recibe dos variables de tipo time t, calcula su diferencia y devuelve el resultado (double) expresado en segundos.
struct tm *gmtime(time t *) Recibe un puntero a una variable de tiempo (time t*) y devuelve su conversion como fecha/hora UTC a struct tm a través de un puntero.
struct tm *localtime(time t *) Similar funcionalidad a gmtime(), pero devuelve la conversión como fecha/hora LOCAL.
time t mktime(struct tm *) Inversamente a gmtime() y localtime(),l recibe un puntero a struct tm (struct tm*) y devuelve su conversión al tipo time t.
time t time(time t *) Devuelve la fecha/hora (time t) actual o -1 en caso de no ser posible. Si el argumento que se le pasa no es NULL, también asigna la fecha/hora actual a dicho argumento.
size_t strftime(char *,size_t,char *,struct tm *) Formatea la información pasada mediante la estructura (struct tm*) mediante el formato indicado en una cadena (char*) e imprime el resultado sobre otra cadena (char*) hasta un límite de caracteres (size_t).

Constantes

Nombre Descripción
CLK_PER_SEC Constante que define el número de pulsos de reloj por segundo; usado por la función clock()
CLOCKS_PER_SEC nombre alternativo para CLK_PER_SEC usado en su lugar en algunas bibliotecas
CLK_TCK usualmente una macro para CLK_PER_SEC

Tipos de datos

Nombre Descripción
clock_t tipo de dato devuelto por clock(), generalmente un long int
time t tipo de dato devuelto por time(), generalmente un long int
struct tm representación del tiempo en formato de calendario (fecha/hora)

Fecha (día/hora) de calendario

La fecha de calendario se representa como la estructura struct tm, que consta de los siguientes atributos:

Atributo Descripción
int tm_hour hora (0 - 23)
int tm_isdst Horario de verano enabled/disabled
int tm_mday día del mes (1 - 31)
int tm_min minutos (0 - 59)
int tm_mon mes (0 - 11, 0 = Enero)
int tm_sec segundos (0 - 60)
int tm_wday día de la semana (0 - 6, 0 = domingo)
int tm_yday día del año (0 - 365)
int tm_year año desde 1900

Véase también

Referencias

Obtenido de "Time.h"

Wikimedia foundation. 2010.

Игры ⚽ Нужна курсовая?

Mira otros diccionarios:

  • Time — Time, n.; pl. {Times}. [OE. time, AS. t[=i]ma, akin to t[=i]d time, and to Icel. t[=i]mi, Dan. time an hour, Sw. timme. [root]58. See {Tide}, n.] 1. Duration, considered independently of any system of measurement or any employment of terms which… …   The Collaborative International Dictionary of English

  • Time — • Article explores two questions, What are the notes, or elements, contained in the subjective representation of time? and To what external reality does this representation correspond? Catholic Encyclopedia. Kevin Knight. 2006. Time     Time …   Catholic encyclopedia

  • Time's Up! — is a grassroots environmental group that seeks to promote a more sustainable, less toxic New York City. For 20 years, it has been committed to improving the environment by empowering individuals to become active in their community. In New York… …   Wikipedia

  • TIME — (magazine) Pour les articles homonymes, voir Time.  Time Magazine {{{nomorigine}}} …   Wikipédia en Français

  • time — ► NOUN 1) the indefinite continued progress of existence and events in the past, present, and future, regarded as a whole. 2) a point of time as measured in hours and minutes past midnight or noon. 3) the favourable or appropriate moment to do… …   English terms dictionary

  • TIME — Erstausgabe 1923 Beschreibung Nachrichtenmagazi …   Deutsch Wikipedia

  • Time — Time …   Deutsch Wikipedia

  • Time UK — is a computer retailer set up by the people behind the failed Time Computer Systems.The company is based within the main factory offices at Time Technology Park in Simonstone, near Burnley in Lancashire. The company specializes in providing… …   Wikipedia

  • TIME — Premier élément d’un gigantesque empire de presse dont l’histoire est intimement liée à l’action d’une des plus fortes personnalités du journalisme américain, Henry R. Luce (1903 1967), et à son ami Britton Hadden. La création du Time Weekly News …   Encyclopédie Universelle

  • time — (izg. tȃjm) m DEFINICIJA vrijeme, ob. u sportu (znak u tenisu da igrači moraju izići na teren i sl.) SINTAGMA common time (izg. kòmon time) glazb. naziv za 4/4 mjeru; time charter (izg. tȃjmčārter) pom. trg. ugovor o najmu prijevoznog sredstva na …   Hrvatski jezični portal

Compartir el artículo y extractos

Link directo
Do a right-click on the link above
and select “Copy Link”