🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #10217

Re: Leer fecha sistema. "C".

#10217
From: edusito
Date: Fri, 15 Mar 2002 12:52
24 lines
1385 bytes
"pmj" <in@terra.es> wrote in message news:<a6q446$ci5$1@talia.mad.ttd.net>...
> Hola,
> 
> � C�mo puedo leer la fecha del sistema desde un programa hecho en C. ?
> 
> Gracias.

Hola

struct tm * stm;
time_t tt;

      tt = time(NULL);
      stm = localtime(&tt);
      strftime(var_date,20,"%d/%m/%Y %H:%M:%S",stm);

Con la funcion strftime formateas en una cadena de caracteres una
fecha almacenada en una estructura de tipo struct tm. Mira la p�gina
de manual
de strftime para obtener una descripcion de los formatos.

Saludines

Edu
Technical Details
Message-ID: <393aced8.0203150452.223585ca@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
References: <a6q446$ci5$1@talia.mad.ttd.net>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,744fbdf06690c5cb
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-03-15 04:52:30 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: zoyeredu@yahoo.com (edusito)
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Leer fecha sistema. "C".
Date: 15 Mar 2002 04:52:30 -0800
Organization: http://groups.google.com/
Lines: 24
Message-ID: <393aced8.0203150452.223585ca@posting.google.com>
References: <a6q446$ci5$1@talia.mad.ttd.net>
NNTP-Posting-Host: 62.81.27.253
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1016196750 10682 127.0.0.1 (15 Mar 2002 12:52:30 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 15 Mar 2002 12:52:30 GMT