[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] Unix time
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] Unix time
- From: mario andre <rower.master (at) gmail.com>
- Date: Tue, 19 Jul 2005 15:43:54 -0300
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Ig1Fz0bMIhjbaNND/+q7uKQQ8Y+7wTH78eeFL0F+2ugKyAPtl+T3/LW5HZYHAX41iDjBEOHyY3dUdJoekqFIXKO2pb0J+PrxM69nA/RR7LWZpwwpLe/sWNoLQLKS/GAyxqAwortO1GuI7xeVF53K/1p1EKF43ffHRXwTacupZMk=
- References: <e73320da05071911014e013fcc@mail.gmail.com> <20050719182553.GA2667@hswn.dk>
Thanks henrik and Paul.
On 7/19/05, Henrik Stoerner <henrik (at) hswn.dk> wrote:
> On Tue, Jul 19, 2005 at 03:01:39PM -0300, mario andre wrote:
> >
> > Somebody knows how to convert the unix time format to the utc?
>
> This little program will do it:
>
> --- showtime.c ---
> #include <time.h>
> #include <stdlib.h>
> #include <stdio.h>
>
> int main(int argc, char *argv[])
> {
> time_t t = atol(argv[1]);
>
> printf("%s\n", asctime(gmtime(&t)));
> return 0;
> }
>
> --- end of file ---
>
> Save this as showtime.c, then "cc -o showtime showtime.c".
> Then you can run "showtime 1121797513" and get "Tue Jul 19 18:25:13
> 2005"
>
>
> Henrik
>
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe (at) hswn.dk
>
>
>